forked from AuroraMiddleware/gtk
Simplify GtkColorScale private api a bit
This commit is contained in:
parent
6ed16b5b41
commit
1f68d7d827
@ -396,23 +396,17 @@ gtk_color_editor_init (GtkColorEditor *editor)
|
|||||||
g_signal_connect (editor->priv->entry, "focus-out-event",
|
g_signal_connect (editor->priv->entry, "focus-out-event",
|
||||||
G_CALLBACK (entry_focus_out), editor);
|
G_CALLBACK (entry_focus_out), editor);
|
||||||
|
|
||||||
editor->priv->h_slider = slider = g_object_new (GTK_TYPE_COLOR_SCALE,
|
editor->priv->h_slider = slider = gtk_color_scale_new (editor->priv->h_adj,
|
||||||
"adjustment", editor->priv->h_adj,
|
GTK_COLOR_SCALE_HUE);
|
||||||
"draw-value", FALSE,
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (slider), GTK_ORIENTATION_VERTICAL);
|
||||||
"orientation", GTK_ORIENTATION_VERTICAL,
|
|
||||||
NULL);
|
|
||||||
gtk_color_scale_set_type (GTK_COLOR_SCALE (slider), GTK_COLOR_SCALE_HUE);
|
|
||||||
if (gtk_widget_get_direction (slider) == GTK_TEXT_DIR_RTL)
|
if (gtk_widget_get_direction (slider) == GTK_TEXT_DIR_RTL)
|
||||||
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
||||||
else
|
else
|
||||||
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
||||||
|
|
||||||
editor->priv->a_slider = slider = g_object_new (GTK_TYPE_COLOR_SCALE,
|
editor->priv->a_slider = slider = gtk_color_scale_new (editor->priv->a_adj,
|
||||||
"adjustment", editor->priv->a_adj,
|
GTK_COLOR_SCALE_ALPHA);
|
||||||
"draw-value", FALSE,
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (slider), GTK_ORIENTATION_HORIZONTAL);
|
||||||
"orientation", GTK_ORIENTATION_HORIZONTAL,
|
|
||||||
NULL);
|
|
||||||
gtk_color_scale_set_type (GTK_COLOR_SCALE (slider), GTK_COLOR_SCALE_ALPHA);
|
|
||||||
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
gtk_style_context_add_class (gtk_widget_get_style_context (slider), GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
||||||
|
|
||||||
editor->priv->sv_plane = gtk_color_plane_new (editor->priv->h_adj,
|
editor->priv->sv_plane = gtk_color_plane_new (editor->priv->h_adj,
|
||||||
|
@ -309,7 +309,7 @@ gtk_color_scale_set_color (GtkColorScale *scale,
|
|||||||
gtk_widget_queue_draw (GTK_WIDGET (scale));
|
gtk_widget_queue_draw (GTK_WIDGET (scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gtk_color_scale_set_type (GtkColorScale *scale,
|
gtk_color_scale_set_type (GtkColorScale *scale,
|
||||||
GtkColorScaleType type)
|
GtkColorScaleType type)
|
||||||
{
|
{
|
||||||
@ -333,10 +333,16 @@ gtk_color_scale_set_type (GtkColorScale *scale,
|
|||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
gtk_color_scale_new (void)
|
gtk_color_scale_new (GtkAdjustment *adjustment,
|
||||||
|
GtkColorScaleType type)
|
||||||
{
|
{
|
||||||
return (GtkWidget *) g_object_new (GTK_TYPE_COLOR_SCALE,
|
GtkWidget *scale;
|
||||||
"adjustment", gtk_adjustment_new (0, 0, 1, 0.01, 0.1, 0),
|
|
||||||
"draw-value", FALSE,
|
scale = (GtkWidget *) g_object_new (GTK_TYPE_COLOR_SCALE,
|
||||||
NULL);
|
"adjustment", adjustment,
|
||||||
|
"draw-value", FALSE,
|
||||||
|
NULL);
|
||||||
|
gtk_color_scale_set_type (GTK_COLOR_SCALE (scale), type);
|
||||||
|
|
||||||
|
return scale;
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,9 @@ G_GNUC_INTERNAL
|
|||||||
GType gtk_color_scale_get_type (void) G_GNUC_CONST;
|
GType gtk_color_scale_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
GtkWidget * gtk_color_scale_new (void);
|
GtkWidget * gtk_color_scale_new (GtkAdjustment *adjustment,
|
||||||
G_GNUC_INTERNAL
|
|
||||||
void gtk_color_scale_set_type (GtkColorScale *scale,
|
|
||||||
GtkColorScaleType type);
|
GtkColorScaleType type);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
void gtk_color_scale_set_color (GtkColorScale *scale,
|
void gtk_color_scale_set_color (GtkColorScale *scale,
|
||||||
const GdkRGBA *color);
|
const GdkRGBA *color);
|
||||||
|
Loading…
Reference in New Issue
Block a user