зеркало из https://github.com/mozilla/pjs.git
Fake scrollbar allocation more effectively to trick ClearLooks into drawing correctly rounded buttons. b=336270 r+sr=roc
This commit is contained in:
Родитель
e80f2d5166
Коммит
70057389cb
|
@ -682,20 +682,25 @@ moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
|
|||
scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);
|
||||
else
|
||||
scrollbar = GTK_SCROLLBAR(gHorizScrollbarWidget);
|
||||
|
||||
|
||||
/* Some theme engines (i.e., ClearLooks) check the scrollbar's allocation
|
||||
to determine where it should paint rounded corners on the buttons.
|
||||
We need to trick them into drawing the buttons the way we want them. */
|
||||
|
||||
GTK_WIDGET(scrollbar)->allocation.x = rect->x;
|
||||
GTK_WIDGET(scrollbar)->allocation.y = rect->y;
|
||||
GTK_WIDGET(scrollbar)->allocation.width = 2 * rect->width;
|
||||
GTK_WIDGET(scrollbar)->allocation.height = 2 * rect->height;
|
||||
GTK_WIDGET(scrollbar)->allocation.width = rect->width;
|
||||
GTK_WIDGET(scrollbar)->allocation.height = rect->height;
|
||||
|
||||
if (type == GTK_ARROW_DOWN)
|
||||
GTK_WIDGET(scrollbar)->allocation.y -= rect->height;
|
||||
else if (type == GTK_ARROW_RIGHT)
|
||||
GTK_WIDGET(scrollbar)->allocation.x -= rect->width;
|
||||
if (type < 2) {
|
||||
GTK_WIDGET(scrollbar)->allocation.height *= 3;
|
||||
if (type == GTK_ARROW_DOWN)
|
||||
GTK_WIDGET(scrollbar)->allocation.y -= 2 * rect->height;
|
||||
} else {
|
||||
GTK_WIDGET(scrollbar)->allocation.width *= 3;
|
||||
if (type == GTK_ARROW_RIGHT)
|
||||
GTK_WIDGET(scrollbar)->allocation.x -= 2 * rect->width;
|
||||
}
|
||||
|
||||
style = GTK_WIDGET(scrollbar)->style;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче