QPalette palette = QCleanlooksStyle::standardPalette();
if (d->isThemeAvailable()) {
GtkStyle *style = d->gtkStyle();
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
GtkWidget *gtkEntry = d->getTextColorWidget();
GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg;
QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt;
palette.setColor(QPalette::Base, base);
QColor alternateRowColor = palette.base().color().lighter(93); // ref gtkstyle.c draw_flat_box
- GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+ GtkWidget *gtkTreeView = d->gtkWidget(QLatin1String("GtkTreeView"));
GdkColor *gtkAltBase = NULL;
gtk_widget_style_get(gtkTreeView, "odd-row-color", >kAltBase, NULL);
if (gtkAltBase) {
return 0;
case PM_ButtonShiftHorizontal: {
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
guint horizontal_shift;
gtk_widget_style_get(gtkButton, "child-displacement-x", &horizontal_shift, NULL);
return horizontal_shift;
}
case PM_ButtonShiftVertical: {
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
guint vertical_shift;
gtk_widget_style_get(gtkButton, "child-displacement-y", &vertical_shift, NULL);
return vertical_shift;
return 0;
case PM_MenuPanelWidth: {
- GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+ GtkWidget *gtkMenu = d->gtkWidget(QLatin1String("GtkMenu"));
guint horizontal_padding = 0;
// horizontal-padding is used by Maemo to get thicker borders
if (!gtk_check_version(2, 10, 0))
case PM_SliderThickness:
case PM_SliderControlThickness: {
- GtkWidget *gtkScale = d->gtkWidget("GtkHScale");
+ GtkWidget *gtkScale = d->gtkWidget(QLatin1String("GtkHScale"));
gint val;
gtk_widget_style_get(gtkScale, "slider-width", &val, NULL);
if (metric == PM_SliderControlThickness)
case PM_ScrollBarExtent: {
gint sliderLength;
gint trough_border;
- GtkWidget *hScrollbar = d->gtkWidget("GtkHScrollbar");
+ GtkWidget *hScrollbar = d->gtkWidget(QLS("GtkHScrollbar"));
gtk_widget_style_get(hScrollbar,
"trough-border", &trough_border,
"slider-width", &sliderLength,
case PM_SliderLength:
gint val;
- gtk_widget_style_get(d->gtkWidget("GtkHScale"), "slider-length", &val, NULL);
+ gtk_widget_style_get(d->gtkWidget(QLS("GtkHScale")), "slider-length", &val, NULL);
return val;
case PM_ExclusiveIndicatorWidth:
case PM_ExclusiveIndicatorHeight:
case PM_IndicatorWidth:
case PM_IndicatorHeight: {
- GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+ GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
gint size, spacing;
gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, "indicator-size", &size, NULL);
return size + 2 * spacing;
}
case PM_MenuBarVMargin: {
- GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+ GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
return qMax(0, gtkMenubar->style->ythickness);
}
case PM_ScrollView_ScrollBarSpacing:
{
gint spacing = 3;
- GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow");
+ GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow"));
Q_ASSERT(gtkScrollWindow);
gtk_widget_style_get(gtkScrollWindow, "scrollbar-spacing", &spacing, NULL);
return spacing;
}
case PM_SubMenuOverlap: {
gint offset = 0;
- GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+ GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
gtk_widget_style_get(gtkMenu, "horizontal-offset", &offset, NULL);
return offset;
}
{
if (d->isKDE4Session())
return QCleanlooksStyle::styleHint(hint, option, widget, returnData);
- GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+ GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
GtkToolbarStyle toolbar_style = GTK_TOOLBAR_ICONS;
g_object_get(gtkToolbar, "toolbar-style", &toolbar_style, NULL);
switch (toolbar_style) {
return int(false);
case SH_ComboBox_Popup: {
- GtkWidget *gtkComboBox = d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkComboBox = d->gtkWidget(QLS("GtkComboBox"));
gboolean appears_as_list;
gtk_widget_style_get((GtkWidget*)gtkComboBox, "appears-as-list", &appears_as_list, NULL);
return appears_as_list ? 0 : 1;
if (widget && widget->isWindow())
scrollbars_within_bevel = true;
else if (!gtk_check_version(2, 12, 0)) {
- GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow");
+ GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow"));
gtk_widget_style_get(gtkScrollWindow, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL);
}
return !scrollbars_within_bevel;
GtkStyle *style = gtk_rc_get_style_by_paths(gtk_settings_get_default(),
"*.GtkScrolledWindow", "*.GtkScrolledWindow", gtk_window_get_type());
if (style)
- gtkFramePainter.paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect,
+ gtkFramePainter.paintShadow(d->gtkWidget(QLS("GtkFrame")), "viewport", pmRect,
option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
shadow_type, style);
QPixmapCache::insert(pmKey, pixmap);
break;
case PE_PanelTipLabel: {
- GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); // The Murrine Engine currently assumes a widget is passed
+ GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed
style = gtk_rc_get_style_by_paths(gtk_settings_get_default(), "gtk-tooltips", "GtkWindow",
gtk_window_get_type());
gtkPainter.paintFlatBox(gtkWindow, "tooltip", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, style);
break;
}
GtkShadowType shadow_type;
- GtkWidget *gtkStatusbarFrame = d->gtkWidget("GtkStatusbar.GtkFrame");
+ GtkWidget *gtkStatusbarFrame = d->gtkWidget(QLS("GtkStatusbar.GtkFrame"));
gtk_widget_style_get(gtkStatusbarFrame->parent, "shadow-type", &shadow_type, NULL);
gtkPainter.paintShadow(gtkStatusbarFrame, "frame", option->rect, GTK_STATE_NORMAL,
shadow_type, gtkStatusbarFrame->style);
case PE_IndicatorHeaderArrow:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
- GtkWidget *gtkTreeHeader = d->gtkWidget("GtkTreeView.GtkButton");
+ GtkWidget *gtkTreeHeader = d->gtkWidget(QLS("GtkTreeView.GtkButton"));
GtkStateType state = gtkPainter.gtkState(option);
style = gtkTreeHeader->style;
GtkArrowType type = GTK_ARROW_UP;
QRect frameRect = option->rect.adjusted(1, 1, -1, -2);
if (qobject_cast<const QTabBar*>(widget)) {
- GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+ GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
style = gtkPainter.getStyle(gtkNotebook);
gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style);
} else {
rect.translate(2, 0);
GtkExpanderStyle openState = GTK_EXPANDER_EXPANDED;
GtkExpanderStyle closedState = GTK_EXPANDER_COLLAPSED;
- GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+ GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"));
GtkStateType state = GTK_STATE_NORMAL;
if (!(option->state & State_Enabled))
if (!(option->state & State_Selected))
break;
}
- if (GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView")) {
+ if (GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"))) {
const char *detail = "cell_even_ruled";
if (vopt && vopt->features & QStyleOptionViewItemV2::Alternate)
detail = "cell_odd_ruled";
case PE_IndicatorToolBarSeparator:
{
const int margin = 6;
- GtkWidget *gtkSeparator = d->gtkWidget("GtkToolbar.GtkSeparatorToolItem");
+ GtkWidget *gtkSeparator = d->gtkWidget(QLS("GtkToolbar.GtkSeparatorToolItem"));
if (option->state & State_Horizontal) {
const int offset = option->rect.width()/2;
QRect rect = option->rect.adjusted(offset, margin, 0, -margin);
break;
case PE_IndicatorToolBarHandle: {
- GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+ GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
GtkShadowType shadow_type;
gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);
//Note when the toolbar is horizontal, the handle is vertical
GtkStateType state = gtkPainter.gtkState(option);
QColor arrowColor = option->palette.buttonText().color();
- GtkWidget *gtkArrow = d->gtkWidget("GtkArrow");
+ GtkWidget *gtkArrow = d->gtkWidget(QLS("GtkArrow"));
GdkColor color = fromQColor(arrowColor);
gtk_widget_modify_fg (gtkArrow, state, &color);
gtkPainter.paintArrow(gtkArrow, "button", arrowRect,
break;
case PE_PanelMenu: {
- GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+ GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
gtkPainter.setAlphaSupport(false); // Note, alpha disabled for performance reasons
gtkPainter.paintBox(gtkMenu, "menu", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, gtkMenu->style, QString());
}
// This is only used by floating tool bars
if (qobject_cast<const QToolBar *>(widget)) {
- GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+ GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
gtkPainter.paintBox( gtkMenubar, "toolbar", option->rect,
GTK_STATE_NORMAL, GTK_SHADOW_OUT, style);
gtkPainter.paintBox( gtkMenubar, "menu", option->rect,
break;
case PE_FrameLineEdit: {
- GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+ GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
gboolean interior_focus;
case PE_PanelLineEdit:
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+ GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
if (panel->lineWidth > 0)
proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget);
uint resolve_mask = option->palette.resolve();
case PE_FrameTabWidget:
if (const QStyleOptionTabWidgetFrame *frame = qstyleoption_cast<const QStyleOptionTabWidgetFrame*>(option)) {
- GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+ GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
style = gtkPainter.getStyle(gtkNotebook);
gtkPainter.setAlphaSupport(false);
GtkShadowType shadow = GTK_SHADOW_OUT;
GtkStateType state = gtkPainter.gtkState(option);
if (option->state & State_On || option->state & State_Sunken)
state = GTK_STATE_ACTIVE;
- GtkWidget *gtkButton = isTool ? d->gtkWidget("GtkToolButton.GtkButton") : d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = isTool ? d->gtkWidget(QLS("GtkToolButton.GtkButton")) : d->gtkWidget(QLS("GtkButton"));
gint focusWidth, focusPad;
gboolean interiorFocus = false;
gtk_widget_style_get (gtkButton,
else
shadow = GTK_SHADOW_OUT;
- GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton");
+ GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton"));
gint spacing;
gtk_widget_style_get(gtkRadioButton, "indicator-spacing", &spacing, NULL);
QRect buttonRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing);
gtkPainter.setClipRect(option->rect);
// ### Note: Ubuntulooks breaks when the proper widget is passed
// Murrine engine requires a widget not to get RGBA check - warnings
- GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+ GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
QString key(QLS("radiobutton"));
if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag
key += QLatin1Char('f');
int spacing;
- GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+ GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
QString key(QLS("checkbutton"));
if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag
key += QLatin1Char('f');
if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
// Draw prelight background
- GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+ GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
if (option->state & State_MouseOver) {
QRect bgRect = textRect | checkBoxRect;
GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ?
GTK_SHADOW_IN : GTK_SHADOW_OUT;
- const QHashableLatin1Literal comboBoxPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
+ const QString comboBoxPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry") : QLatin1String("GtkComboBox");
// We use the gtk widget to position arrows and separators for us
GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath);
gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
gtk_widget_size_allocate(gtkCombo, &geometry);
- QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
- : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+ QString buttonPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry.GtkToggleButton")
+ : QLatin1String("GtkComboBox.GtkToggleButton");
GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath);
gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
// Draw the combo box as a line edit with a button next to it
if (comboBox->editable || appears_as_list) {
GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
- QHashableLatin1Literal entryPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
+ QString entryPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry.GtkEntry") : QLatin1String("GtkComboBox.GtkFrame");
GtkWidget *gtkEntry = d->gtkWidget(entryPath);
gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
QRect frameRect = option->rect;
else {
gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect,
option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
- GTK_SHADOW_NONE, gtkEntry->style, entryPath.toString() + QString::number(focus));
+ GTK_SHADOW_NONE, gtkEntry->style, entryPath + QString::number(focus));
}
gtkCachedPainter.paintShadow(gtkEntry, comboBox->editable ? "entry" : "frame", frameRect, frameState,
- GTK_SHADOW_IN, gtkEntry->style, entryPath.toString() +
+ GTK_SHADOW_IN, gtkEntry->style, entryPath +
QString::number(focus) + QString::number(comboBox->editable) +
QString::number(option->direction));
if (focus)
Q_ASSERT(gtkToggleButton);
gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState,
- shadow, gtkToggleButton->style, buttonPath.toString() +
+ shadow, gtkToggleButton->style, buttonPath +
QString::number(focus) + QString::number(option->direction));
if (focus)
GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
gtkCachedPainter.paintBox(gtkToggleButton, "button",
buttonRect, state,
shadow, gtkToggleButton->style,
- buttonPath.toString() + QString::number(focus));
+ buttonPath + QString::number(focus));
if (focus)
GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
// Draw the separator between label and arrows
- QHashableLatin1Literal vSeparatorPath = comboBox->editable
- ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
- : QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
+ QString vSeparatorPath = comboBox->editable
+ ? QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
+ : QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
if (GtkWidget *gtkVSeparator = d->gtkWidget(vSeparatorPath)) {
QRect vLineRect(gtkVSeparator->allocation.x,
gtkCachedPainter.paintVline( gtkVSeparator, "vseparator",
vLineRect, state, gtkVSeparator->style,
- 0, vLineRect.height(), 0, vSeparatorPath.toString());
+ 0, vLineRect.height(), 0, vSeparatorPath);
gint interiorFocus = true;
else
state = GTK_STATE_NORMAL;
- QHashableLatin1Literal arrowPath("");
+ QString arrowPath = QLatin1String("");
if (comboBox->editable) {
if (appears_as_list)
- arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
+ arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
else
- arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow");
+ arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow");
} else {
if (appears_as_list)
- arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkArrow");
+ arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkArrow");
else
- arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
+ arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
}
GtkWidget *gtkArrow = d->gtkWidget(arrowPath);
if (sunken) {
int xoff, yoff;
- const QHashableLatin1Literal toggleButtonPath = comboBox->editable
- ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
- : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+ const QString toggleButtonPath = comboBox->editable
+ ? QLatin1String("GtkComboBoxEntry.GtkToggleButton")
+ : QLatin1String("GtkComboBox.GtkToggleButton");
GtkWidget *gtkButton = d->gtkWidget(toggleButtonPath);
gtk_widget_style_get(gtkButton, "child-displacement-x", &xoff, NULL);
gtkCachedPainter.setClipRect(option->rect);
gtkCachedPainter.paintArrow( gtkArrow, "arrow", arrowRect,
GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, TRUE,
- style, arrowPath.toString() + QString::number(option->direction));
+ style, arrowPath + QString::number(option->direction));
}
}
END_STYLE_PIXMAPCACHE;
QStyleOptionToolButton label = *toolbutton;
label.state = bflags;
- GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton"));
QPalette pal = toolbutton->palette;
if (option->state & State_Enabled &&
option->state & State_MouseOver && !(widget && widget->testAttribute(Qt::WA_SetPalette))) {
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
- GtkWidget *gtkHScrollBar = d->gtkWidget("GtkHScrollbar");
- GtkWidget *gtkVScrollBar = d->gtkWidget("GtkVScrollbar");
+ GtkWidget *gtkHScrollBar = d->gtkWidget(QLS("GtkHScrollbar"));
+ GtkWidget *gtkVScrollBar = d->gtkWidget(QLS("GtkVScrollbar"));
// Fill background in case the scrollbar is partially transparent
painter->fillRect(option->rect, option->palette.background());
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
GtkWidget *gtkSpinButton = spinBox->buttonSymbols == QAbstractSpinBox::NoButtons
- ? d->gtkWidget("GtkEntry")
- : d->gtkWidget("GtkSpinButton");
+ ? d->gtkWidget(QLS("GtkEntry"))
+ : d->gtkWidget(QLS("GtkSpinButton"));
bool isEnabled = (spinBox->state & State_Enabled);
bool hover = isEnabled && (spinBox->state & State_MouseOver);
bool sunken = (spinBox->state & State_Sunken);
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
- GtkWidget *hScaleWidget = d->gtkWidget("GtkHScale");
- GtkWidget *vScaleWidget = d->gtkWidget("GtkVScale");
+ GtkWidget *hScaleWidget = d->gtkWidget(QLS("GtkHScale"));
+ GtkWidget *vScaleWidget = d->gtkWidget(QLS("GtkVScale"));
QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget);
switch (element) {
case CE_ProgressBarLabel:
if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+ GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
if (!gtkProgressBar)
return;
if (button->features & QStyleOptionButton::HasMenu)
ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0);
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
QPalette pal = button->palette;
int labelState = GTK_STATE_INSENSITIVE;
if (option->state & State_Enabled)
bool isRadio = (element == CE_RadioButton);
// Draw prelight background
- GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton");
+ GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton"));
if (option->state & State_MouseOver) {
gtkPainter.paintFlatBox(gtkRadioButton, "checkbutton", option->rect,
}
if (!cb->currentText.isEmpty() && !cb->editable) {
- GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox"));
QPalette pal = cb->palette;
int labelState = GTK_STATE_INSENSITIVE;
// Draws the header in tables.
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
Q_UNUSED(header);
- GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+ GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"));
// Get the middle column
GtkTreeViewColumn *column = gtk_tree_view_get_column((GtkTreeView*)gtkTreeView, 1);
Q_ASSERT(column);
#ifndef QT_NO_SIZEGRIP
case CE_SizeGrip: {
- GtkWidget *gtkStatusbar = d->gtkWidget("GtkStatusbar.GtkFrame");
+ GtkWidget *gtkStatusbar = d->gtkWidget(QLS("GtkStatusbar.GtkFrame"));
QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness);
gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
#endif // QT_NO_SIZEGRIP
case CE_MenuBarEmptyArea: {
- GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+ GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
GdkColor gdkBg = gtkMenubar->style->bg[GTK_STATE_NORMAL]; // Theme can depend on transparency
painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8));
if (widget) { // See CE_MenuBarItem
painter->save();
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
- GtkWidget *gtkMenubarItem = d->gtkWidget("GtkMenuBar.GtkMenuItem");
- GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+ GtkWidget *gtkMenubarItem = d->gtkWidget(QLS("GtkMenuBar.GtkMenuItem"));
+ GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
style = gtkMenubarItem->style;
break;
case CE_Splitter: {
- GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); // The Murrine Engine currently assumes a widget is passed
+ GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed
gtkPainter.paintHandle(gtkWindow, "splitter", option->rect, gtkPainter.gtkState(option), GTK_SHADOW_NONE,
!(option->state & State_Horizontal) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL,
style);
if (toolbar->positionWithinLine != QStyleOptionToolBar::End)
rect.adjust(0, 0, 1, 0);
- GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+ GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
GtkShadowType shadow_type = GTK_SHADOW_NONE;
gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);
gtkPainter.paintBox( gtkToolbar, "toolbar", rect,
const int windowsItemHMargin = 3; // menu item hor text margin
const int windowsItemVMargin = 26; // menu item ver text margin
const int windowsRightBorder = 15; // right border on windows
- GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget("GtkMenu.GtkCheckMenuItem") :
- d->gtkWidget("GtkMenu.GtkMenuItem");
+ GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) :
+ d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
style = gtkPainter.getStyle(gtkMenuItem);
QColor shadow = option->palette.dark().color();
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
- GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem");
+ GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
painter->setPen(shadow.lighter(106));
gboolean wide_separators = 0;
gint separator_height = 0;
bool ignoreCheckMark = false;
gint checkSize;
- gtk_widget_style_get(d->gtkWidget("GtkMenu.GtkCheckMenuItem"), "indicator-size", &checkSize, NULL);
+ gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);
int checkcol = qMax(menuItem->maxIconWidth, qMax(20, checkSize));
case CE_PushButton:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget);
QStyleOptionButton subopt = *btn;
subopt.rect = subElementRect(SE_PushButtonContents, btn, widget);
case CE_TabBarTabShape:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
- GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+ GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
style = gtkPainter.getStyle(gtkNotebook);
QRect rect = option->rect;
case CE_ProgressBarGroove:
if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
Q_UNUSED(bar);
- GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+ GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
GtkStateType state = gtkPainter.gtkState(option);
gtkPainter.paintBox( gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, gtkProgressBar->style);
}
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
GtkStateType state = option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
- GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+ GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
style = gtkProgressBar->style;
gtkPainter.paintBox( gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, style);
int xt = style->xthickness;
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
- GtkWidget *gtkSpinButton = d->gtkWidget("GtkSpinButton");
+ GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton"));
int center = spinbox->rect.height() / 2;
int xt = spinbox->frame ? gtkSpinButton->style->xthickness : 0;
int yt = spinbox->frame ? gtkSpinButton->style->ythickness : 0;
case CC_ComboBox:
if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
// We employ the gtk widget to position arrows and separators for us
- GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry")
- : d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkCombo = box->editable ? d->gtkWidget(QLS("GtkComboBoxEntry"))
+ : d->gtkWidget(QLS("GtkComboBox"));
gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())};
gtk_widget_size_allocate(gtkCombo, &geometry);
int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget);
- QHashableLatin1Literal arrowPath("GtkComboBoxEntry.GtkToggleButton");
+ QString arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton");
if (!box->editable) {
if (appears_as_list)
- arrowPath = "GtkComboBox.GtkToggleButton";
+ arrowPath = QLatin1String("GtkComboBox.GtkToggleButton");
else
- arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow";
+ arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
}
GtkWidget *arrowWidget = d->gtkWidget(arrowPath);
case CT_ToolButton:
if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
- GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton"));
newSize = size + QSize(2 * gtkButton->style->xthickness, 2 + 2 * gtkButton->style->ythickness);
if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) {
QSize minSize(0, 25);
int textMargin = 8;
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
- GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem");
+ GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
GtkRequisition sizeReq = {0, 0};
gtk_widget_size_request(gtkMenuSeparator, &sizeReq);
newSize = QSize(size.width(), sizeReq.height);
break;
}
- GtkWidget *gtkMenuItem = d->gtkWidget("GtkMenu.GtkCheckMenuItem");
+ GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem"));
GtkStyle* style = gtkMenuItem->style;
// Note we get the perfect height for the default font since we
case CT_SpinBox:
// QSpinBox does some nasty things that depends on CT_LineEdit
- newSize = size + QSize(0, -d->gtkWidget("GtkSpinButton")->style->ythickness * 2);
+ newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2);
break;
case CT_PushButton:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
gint focusPadding, focusWidth;
gtk_widget_style_get(gtkButton, "focus-padding", &focusPadding, NULL);
gtk_widget_style_get(gtkButton, "focus-line-width", &focusWidth, NULL);
newSize += QSize(2*gtkButton->style->xthickness + 4, 2*gtkButton->style->ythickness);
newSize += QSize(2*(focusWidth + focusPadding + 2), 2*(focusWidth + focusPadding));
- GtkWidget *gtkButtonBox = d->gtkWidget("GtkHButtonBox");
+ GtkWidget *gtkButtonBox = d->gtkWidget(QLS("GtkHButtonBox"));
gint minWidth = 85, minHeight = 0;
gtk_widget_style_get(gtkButtonBox, "child-min-width", &minWidth,
"child-min-height", &minHeight, NULL);
break;
case CT_Slider: {
- GtkWidget *gtkSlider = d->gtkWidget("GtkHScale");
+ GtkWidget *gtkSlider = d->gtkWidget(QLS("GtkHScale"));
newSize = size + QSize(2*gtkSlider->style->xthickness, 2*gtkSlider->style->ythickness);
}
break;
case CT_LineEdit: {
- GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+ GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
newSize = size + QSize(2*gtkEntry->style->xthickness, 2 + 2*gtkEntry->style->ythickness);
}
break;
case CT_ComboBox:
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
- GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox"));
QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget);
newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkCombo->style->xthickness, 4 + 2*gtkCombo->style->ythickness);
return option->rect;
case SE_PushButtonContents:
if (!gtk_check_version(2, 10, 0)) {
- GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
GtkBorder *border = 0;
gtk_widget_style_get(gtkButton, "inner-border", &border, NULL);
if (border) {
return r;
}
-/*!
- \reimp
-*/
-QRect QGtkStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
-{
- return QCleanlooksStyle::itemPixmapRect(r, flags, pixmap);
-}
-
-/*!
- \reimp
-*/
-void QGtkStyle::drawItemPixmap(QPainter *painter, const QRect &rect,
- int alignment, const QPixmap &pixmap) const
-{
- QCleanlooksStyle::drawItemPixmap(painter, rect, alignment, pixmap);
-}
-
-/*!
- \reimp
-*/
-QStyle::SubControl QGtkStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w) const
-{
- return QCleanlooksStyle::hitTestComplexControl(cc, opt, pt, w);
-}
-
-/*!
- \reimp
-*/
-QPixmap QGtkStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
- const QStyleOption *opt) const
-{
- return QCleanlooksStyle::generatedIconPixmap(iconMode, pixmap, opt);
-}
-
-/*!
- \reimp
-*/
-void QGtkStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
- bool enabled, const QString& text, QPalette::ColorRole textRole) const
-{
- return QCleanlooksStyle::drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
-}
-
QT_END_NAMESPACE