1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-05 21:02:42 +02:00

libgimpwidgets: Use arrows for GimpSpinScale cursors

The "grabbing" cursor currently used is quite large on
newer versions of GTK3, and makes it difficult for users
to see where they're grabbing. This patch switches to
using "pointer" cursor for hovering over the slider area,
and "col-resize" when actually moving the slider.
It also reverts padding changes in CSS so that the progress
bar aligns with the place the user clicks. Padding is added
in Cairo for the label, though the number entry is now
flush against the input buttons.
This commit is contained in:
Alx Sa
2025-04-13 12:57:07 +00:00
parent d2a7586b67
commit 9a1984a707
3 changed files with 8 additions and 11 deletions

View File

@@ -425,9 +425,9 @@ gimp_spin_scale_draw (GtkWidget *widget,
gtk_entry_get_layout_offsets (GTK_ENTRY (widget), NULL, &layout_offset_y);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
layout_offset_x = text_area.x + text_area.width - ink.width - 2;
layout_offset_x = text_area.x + text_area.width - ink.width - 6;
else
layout_offset_x = text_area.x + 2;
layout_offset_x = text_area.x + 6;
layout_offset_x -= ink.x;
@@ -632,7 +632,7 @@ static void
gimp_spin_scale_update_cursor (GtkWidget *widget,
GdkWindow *window)
{
GimpSpinScale *scale = GIMP_SPIN_SCALE (widget);
GimpSpinScale *scale = GIMP_SPIN_SCALE (widget);
GdkDisplay *display = gtk_widget_get_display (widget);
GdkCursor *cursor = NULL;
@@ -643,13 +643,10 @@ gimp_spin_scale_update_cursor (GtkWidget *widget,
break;
case TARGET_GRAB:
cursor = gdk_cursor_new_from_name (display, "grab");
cursor = gdk_cursor_new_from_name (display, "pointer");
break;
case TARGET_GRABBING:
cursor = gdk_cursor_new_from_name (display, "grabbing");
break;
case TARGET_RELATIVE:
cursor = gdk_cursor_new_from_name (display, "col-resize");
break;

View File

@@ -579,7 +579,7 @@ GimpSpinScale entry {
border-radius: 5px 0px 0px 5px;
border-right-width: 0px;
box-shadow: none;
padding: 0px 8px 0px 5px;
padding: 0px;
}
GimpSpinScale entry progress {
@@ -587,7 +587,7 @@ GimpSpinScale entry progress {
background-image: none;
border-width: 0px;
border-radius: 3px 0px 0px 3px;
margin: 0px -8px 0px -5px;
margin: 0px;
}
GimpSpinScale button {

View File

@@ -111,14 +111,14 @@ spinbutton entry {
GimpSpinScale entry {
/* Important: prevent overhigh spin scale */
min-height: 16px;
padding: 0px 8px 0px 5px;
padding: 0px;
}
GimpSpinScale entry progress {
background-color: @theme_selected_bg_color;
border-width: 0px;
border-radius: 3px;
margin: 0px -8px 0px -5px;
margin: 0px;
}
GimpSpinScale button {