}
set_selected_palette (colorsel, 0, 0);
priv->palette_frame = gtk_vbox_new (FALSE, 6);
- label = gtk_label_new_with_mnemonic (_("_Palette"));
+ label = gtk_label_new_with_mnemonic (_("_Palette:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (priv->palette_frame), label, FALSE, FALSE, 0);
G_MAXINT,
0,
GTK_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("activate_slider",
+ P_("Draw slider ACTIVE during drag"),
+ P_("With this option set to TRUE, sliders will be drawn ACTIVE and with shadow IN while they are dragged"),
+ FALSE,
+ G_PARAM_READABLE));
}
static void
GtkRange *range;
gboolean sensitive;
GtkStateType state;
+ GtkShadowType shadow_type;
GdkRectangle expose_area; /* Relative to widget->allocation */
GdkRectangle area;
gint focus_line_width = 0;
gint focus_padding = 0;
gboolean touchscreen;
+ gboolean activate_slider;
g_object_get (gtk_widget_get_settings (widget),
"gtk-touchscreen-mode", &touchscreen,
range->range_rect.height);
}
+ shadow_type = GTK_SHADOW_OUT;
+
if (!sensitive)
state = GTK_STATE_INSENSITIVE;
else if (!touchscreen && range->layout->mouse_location == MOUSE_SLIDER)
else
state = GTK_STATE_NORMAL;
+ if (range->layout->grab_location == MOUSE_SLIDER)
+ {
+ gtk_widget_style_get (widget, "activate_slider", &activate_slider, NULL);
+
+ if (activate_slider)
+ {
+ state = GTK_STATE_ACTIVE;
+ shadow_type = GTK_SHADOW_IN;
+ }
+ }
+
if (gdk_rectangle_intersect (&expose_area,
&range->layout->slider,
&area))
gtk_paint_slider (widget->style,
widget->window,
state,
- GTK_SHADOW_OUT,
+ shadow_type,
&area,
widget,
GTK_RANGE_GET_CLASS (range)->slider_detail,
range->layout->mouse_location == MOUSE_SLIDER)
{
gboolean need_value_update = FALSE;
+ gboolean activate_slider;
/* Any button can be used to drag the slider, but you can start
* dragging the slider with a trough click using button 2;
range->slide_initial_coordinate = event->x;
}
+ range_grab_add (range, MOUSE_SLIDER, event->button);
+
+ gtk_widget_style_get (widget, "activate_slider", &activate_slider, NULL);
+
+ /* force a redraw, if the active slider is drawn differently to the prelight one */
+ if (activate_slider)
+ gtk_widget_queue_draw (widget);
+
if (need_value_update)
update_slider_position (range, event->x, event->y);
- range_grab_add (range, MOUSE_SLIDER, event->button);
-
return TRUE;
}