Changeset 80555 in webkit
- Timestamp:
- Mar 8, 2011 2:04:13 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80554 r80555 1 2011-03-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] Do not set juntion sides on scrollbar stepper buttons 6 https://bugs.webkit.org/show_bug.cgi?id=55868 7 8 Fixes rendering of steppers for themes using rounded stepper 9 buttons on scrollbars like Adwaita. 10 11 * platform/gtk/ScrollbarThemeGtk3.cpp: 12 (WebCore::ScrollbarThemeGtk::paintButton): 13 1 14 2011-03-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 15 -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk3.cpp
r80554 r80555 136 136 gtk_style_context_set_state(m_context, static_cast<GtkStateFlags>(flags)); 137 137 138 guint sides = gtk_style_context_get_junction_sides(m_context);139 if (scrollbar->orientation() == VerticalScrollbar)140 sides &= ~(GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM);141 else142 sides &= ~(GTK_JUNCTION_LEFT | GTK_JUNCTION_RIGHT);143 144 switch (part) {145 case BackButtonStartPart:146 sides |= (scrollbar->orientation() == VerticalScrollbar) ? GTK_JUNCTION_BOTTOM : GTK_JUNCTION_RIGHT;147 break;148 case BackButtonEndPart:149 case ForwardButtonEndPart:150 sides |= (scrollbar->orientation() == VerticalScrollbar) ?151 GTK_JUNCTION_TOP | GTK_JUNCTION_BOTTOM : GTK_JUNCTION_RIGHT | GTK_JUNCTION_LEFT;152 break;153 case ForwardButtonStartPart:154 sides |= (scrollbar->orientation() == VerticalScrollbar) ? GTK_JUNCTION_TOP : GTK_JUNCTION_LEFT;155 break;156 default:157 ASSERT_NOT_REACHED();158 }159 gtk_style_context_set_junction_sides(m_context, static_cast<GtkJunctionSides>(sides));160 138 gtk_style_context_add_class(m_context, GTK_STYLE_CLASS_BUTTON); 161 162 139 gtk_render_background(m_context, context->platformContext(), rect.x(), rect.y(), rect.width(), rect.height()); 163 140 gtk_render_frame(m_context, context->platformContext(), rect.x(), rect.y(), rect.width(), rect.height()); … … 166 143 gtk_style_context_get_style(m_context, "arrow-scaling", &arrowScaling, NULL); 167 144 168 IntSize arrowSize = rect.size(); 169 arrowSize.scale(arrowScaling); 170 FloatPoint arrowPoint(rect.x() + (rect.width() - arrowSize.width()) / 2, 171 rect.y() + (rect.height() - arrowSize.height()) / 2); 145 double arrowSize = std::min(rect.width(), rect.height()) * arrowScaling; 146 FloatPoint arrowPoint(rect.x() + (rect.width() - arrowSize) / 2, 147 rect.y() + (rect.height() - arrowSize) / 2); 172 148 173 149 if (flags & GTK_STATE_FLAG_ACTIVE) { … … 180 156 } 181 157 182 gdouble angle , size;158 gdouble angle; 183 159 if (scrollbar->orientation() == VerticalScrollbar) { 184 size = arrowSize.width();185 160 angle = (part == ForwardButtonEndPart || part == ForwardButtonStartPart) ? G_PI : 0; 186 161 } else { 187 size = arrowSize.height();188 162 angle = (part == ForwardButtonEndPart || part == ForwardButtonStartPart) ? G_PI / 2 : 3 * (G_PI / 2); 189 163 } 190 164 191 gtk_render_arrow(m_context, context->platformContext(), angle, arrowPoint.x(), arrowPoint.y(), size);165 gtk_render_arrow(m_context, context->platformContext(), angle, arrowPoint.x(), arrowPoint.y(), arrowSize); 192 166 193 167 gtk_style_context_restore(m_context);
Note: See TracChangeset
for help on using the changeset viewer.