本文整理汇总了C++中Theme::themeStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ Theme::themeStyleSheet方法的具体用法?C++ Theme::themeStyleSheet怎么用?C++ Theme::themeStyleSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::themeStyleSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decorateBrowser
void Theme::decorateBrowser(QAbstractScrollArea *c) const
{
decorateScrollArea(c);
const QColor bg = color("bg");
QColor unfocusedSelectedBg = color("sel_bg");
unfocusedSelectedBg.setRgb(
(bg.red() + unfocusedSelectedBg.red()) / 2,
(bg.green() + unfocusedSelectedBg.green()) / 2,
(bg.blue() + unfocusedSelectedBg.blue()) / 2
);
Theme unfocusedTheme;
for (auto it = m_theme.constBegin(); it != m_theme.constEnd(); ++it)
unfocusedTheme.m_theme[it.key()] = Option(it.value().value());
unfocusedTheme.m_theme["sel_bg"].setValue( serializeColor(unfocusedSelectedBg) );
// colors and font
c->setStyleSheet(
"#ClipboardBrowser,#item,#item_child{"
+ getFontStyleSheet( value("font").toString() ) +
"color:" + themeColorString("fg") + ";"
"background:" + themeColorString("bg") + ";"
"}"
"#ClipboardBrowser::item:alternate{"
"color:" + themeColorString("alt_fg") + ";"
"background:" + themeColorString("alt_bg") + ";"
"}"
"#ClipboardBrowser::item:selected,#item[CopyQ_selected=\"true\"],#item[CopyQ_selected=\"true\"] #item_child{"
"color:" + themeColorString("sel_fg") + ";"
"background:" + themeColorString("sel_bg") + ";"
"}"
"#item #item_child{background:transparent}"
"#item[CopyQ_selected=\"true\"] #item_child{background:transparent}"
// Desaturate selected item background if item list is not focused.
"#ClipboardBrowser::item:selected:!active{"
"background:" + serializeColor( evalColor("sel_bg", unfocusedTheme) ) + ";"
+ unfocusedTheme.themeStyleSheet("sel_item_css") +
"}"
// Omit showing current item outline.
"#ClipboardBrowser::focus{outline:0}"
"#ClipboardBrowser::item:focus{"
+ themeStyleSheet("cur_item_css") +
"}"
+ getToolTipStyleSheet() +
// Allow user to change CSS.
"#ClipboardBrowser{" + themeStyleSheet("item_css") + "}"
"#ClipboardBrowser::item:alternate{" + themeStyleSheet("alt_item_css") + "}"
"#ClipboardBrowser::item:selected{" + themeStyleSheet("sel_item_css") + "}"
"#item_child[CopyQ_item_type=\"notes\"] {"
+ getFontStyleSheet( value("notes_font").toString() ) +
"}"
);
}