mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
[GTK3] Implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache
This commit is contained in:
parent
459d7f575f
commit
07991c52f4
2 changed files with 9 additions and 11 deletions
|
|
@ -1007,6 +1007,13 @@ GetWidgetStyleInternal(WidgetNodeType aNodeType)
|
|||
case MOZ_GTK_PROGRESS_TROUGH:
|
||||
return GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR,
|
||||
GTK_STYLE_CLASS_TROUGH);
|
||||
case MOZ_GTK_PROGRESS_CHUNK: {
|
||||
GtkStyleContext* style =
|
||||
GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR,
|
||||
GTK_STYLE_CLASS_PROGRESSBAR);
|
||||
gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
|
||||
return style;
|
||||
}
|
||||
case MOZ_GTK_GRIPPER:
|
||||
return GetWidgetStyleWithClass(MOZ_GTK_GRIPPER,
|
||||
GTK_STYLE_CLASS_GRIP);
|
||||
|
|
|
|||
|
|
@ -1386,17 +1386,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr, GdkRectangle* rect,
|
|||
GtkTextDirection direction,
|
||||
WidgetNodeType widget)
|
||||
{
|
||||
GtkStyleContext* style;
|
||||
|
||||
if (gtk_check_version(3, 20, 0) != nullptr) {
|
||||
/* Ask for MOZ_GTK_PROGRESS_TROUGH instead of MOZ_GTK_PROGRESSBAR
|
||||
* because ClaimStyleContext() saves/restores that style */
|
||||
style = ClaimStyleContext(MOZ_GTK_PROGRESS_TROUGH, direction);
|
||||
gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
|
||||
gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR);
|
||||
} else {
|
||||
style = ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction);
|
||||
}
|
||||
GtkStyleContext* style =
|
||||
ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction);
|
||||
|
||||
if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
|
||||
widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue