Changeset 181744 in webkit
- Timestamp:
- Mar 19, 2015, 3:24:50 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/gtk/ScrollbarThemeGtk.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181736 r181744 1 2015-03-19 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Scrollbars look bad with GTK+ 3.16 4 https://bugs.webkit.org/show_bug.cgi?id=140800 5 6 Reviewed by Sergio Villar Senin. 7 8 Take margin into account when rendering scrollbars. This fixes the 9 huge scrollbars rendered with GTK+ 3.16. We don't need to check 10 the GTK+ version because in previous versions the marging were 0, 11 so the same code just works. 12 13 * platform/gtk/ScrollbarThemeGtk.cpp: 14 (WebCore::adjustRectAccordingToMargin): 15 (WebCore::ScrollbarThemeGtk::paintTrackBackground): 16 (WebCore::ScrollbarThemeGtk::paintThumb): 17 1 18 2015-03-19 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr> 2 19 -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp
r173110 r181744 279 279 } 280 280 281 static void adjustRectAccordingToMargin(GtkStyleContext* context, GtkStateFlags state, IntRect& rect) 282 { 283 GtkBorder margin; 284 gtk_style_context_get_margin(context, state, &margin); 285 rect.move(margin.left, margin.right); 286 rect.contract(margin.left + margin.right, margin.top + margin.bottom); 287 } 288 281 289 void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 282 290 { … … 294 302 gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_TROUGH); 295 303 304 adjustRectAccordingToMargin(styleContext, static_cast<GtkStateFlags>(0), fullScrollbarRect); 296 305 gtk_render_background(styleContext, context->platformContext()->cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height()); 297 306 gtk_render_frame(styleContext, context->platformContext()->cr(), fullScrollbarRect.x(), fullScrollbarRect.y(), fullScrollbarRect.width(), fullScrollbarRect.height()); … … 328 337 gtk_style_context_set_state(styleContext, static_cast<GtkStateFlags>(flags)); 329 338 330 gtk_render_slider(styleContext, context->platformContext()->cr(), rect.x(), rect.y(), rect.width(), rect.height(), 339 IntRect thumbRect(rect); 340 adjustRectAccordingToMargin(styleContext, static_cast<GtkStateFlags>(flags), thumbRect); 341 gtk_render_slider(styleContext, context->platformContext()->cr(), thumbRect.x(), thumbRect.y(), thumbRect.width(), thumbRect.height(), 331 342 orientation == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL); 332 343
Note:
See TracChangeset
for help on using the changeset viewer.