mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
[GTK3] For Gtk > 3.20 determine scale trough size from trough CSS node and also add border/padding/margin
This commit is contained in:
parent
cfed5f8df1
commit
240fc2a6b6
1 changed files with 8 additions and 10 deletions
|
|
@ -2500,11 +2500,11 @@ void
|
|||
moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width,
|
||||
gint* scale_height)
|
||||
{
|
||||
WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ?
|
||||
MOZ_GTK_SCALE_HORIZONTAL :
|
||||
MOZ_GTK_SCALE_VERTICAL;
|
||||
|
||||
if (gtk_check_version(3, 20, 0) != nullptr) {
|
||||
WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ?
|
||||
MOZ_GTK_SCALE_HORIZONTAL :
|
||||
MOZ_GTK_SCALE_VERTICAL;
|
||||
|
||||
gint thumb_length, thumb_height, trough_border;
|
||||
moz_gtk_get_scalethumb_metrics(orient, &thumb_length, &thumb_height);
|
||||
|
||||
|
|
@ -2520,12 +2520,10 @@ moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width,
|
|||
}
|
||||
ReleaseStyleContext(style);
|
||||
} else {
|
||||
GtkStyleContext* style = ClaimStyleContext(widget);
|
||||
gtk_style_context_get(style, gtk_style_context_get_state(style),
|
||||
"min-width", scale_width,
|
||||
"min-height", scale_height,
|
||||
nullptr);
|
||||
ReleaseStyleContext(style);
|
||||
WidgetNodeType widget = (orient == GTK_ORIENTATION_HORIZONTAL) ?
|
||||
MOZ_GTK_SCALE_TROUGH_HORIZONTAL :
|
||||
MOZ_GTK_SCALE_TROUGH_VERTICAL;
|
||||
moz_gtk_get_widget_min_size(widget, scale_width, scale_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue