mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-25 13:38:44 +01:00
work on skins, documentmode again to false, cause it just looks bad
This commit is contained in:
parent
4afaebbd51
commit
797f06d357
@ -1,13 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<skin version="0.1.1" base="nudus-base">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.1.2" base="nudus-base">
|
||||
<author>
|
||||
<name>akinokonomi</name>
|
||||
<name>akinokonomi, martinrotter</name>
|
||||
</author>
|
||||
<palette>
|
||||
<color key="FgInteresting" >#85ACF6</color>
|
||||
<color key="FgSelectedInteresting" >#D9E3F7</color>
|
||||
<color key="FgError" >#DF5656</color>
|
||||
<color key="FgSelectedError" >#910303</color>
|
||||
<color key="Allright" >#44AA44</color>
|
||||
<color key="FgInteresting">#85ACF6</color>
|
||||
<color key="FgSelectedInteresting">#D9E3F7</color>
|
||||
<color key="FgError">#DF5656</color>
|
||||
<color key="FgSelectedError">#910303</color>
|
||||
<color key="Allright">#44AA44</color>
|
||||
</palette>
|
||||
</skin>
|
||||
<forced-style-palette>true</forced-style-palette>
|
||||
<style-palette>
|
||||
<group id="All">
|
||||
<color role="Base">#373A3D</color>
|
||||
<color role="AlternateBase">#323437</color>
|
||||
<color role="ToolTipBase" brush="Dense1Pattern">#2D2F32</color>
|
||||
<color role="Dark">#202224</color>
|
||||
<color role="Midlight">#292c2e</color>
|
||||
<color role="Mid">#292c2e</color>
|
||||
<color role="Shadow">#292c2e</color>
|
||||
<color role="Light">#323437</color>
|
||||
<color role="Highlight">#8291AD</color>
|
||||
|
||||
<color role="Window" brush="Dense1Pattern">#2D2F32</color>
|
||||
<color role="Button">#323437</color>
|
||||
|
||||
<color role="Text">#D8D8D8</color>
|
||||
<color role="BrightText">#373A3D</color>
|
||||
<color role="HighlightedText">#FFFFFF</color>
|
||||
<color role="PlaceholderText">#A7A7A7</color>
|
||||
<color role="ToolTipText">#D8D8D8</color>
|
||||
<color role="ButtonText">#E7E7E7</color>
|
||||
<color role="WindowText">#D8D8D8</color>
|
||||
<color role="Link">#a1acc1</color>
|
||||
<color role="LinkVisited">#a1acc1</color>
|
||||
|
||||
<color role="NoRole">#2D2F32</color>
|
||||
</group>
|
||||
|
||||
<group id="Disabled">
|
||||
<color role="Text">#999999</color>
|
||||
<color role="ButtonText">#A7A7A7</color>
|
||||
<color role="WindowText">#999999</color>
|
||||
</group>
|
||||
</style-palette>
|
||||
</skin>
|
@ -1,13 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<skin version="0.1.1" base="nudus-base">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.1.2" base="nudus-base">
|
||||
<author>
|
||||
<name>akinokonomi</name>
|
||||
<name>akinokonomi, martinrotter</name>
|
||||
</author>
|
||||
<palette>
|
||||
<color key="FgInteresting" >#3A6FE4</color>
|
||||
<color key="FgSelectedInteresting" >#F0F2FC</color>
|
||||
<color key="FgError" >#E74343</color>
|
||||
<color key="FgSelectedError" >#FFD7D7</color>
|
||||
<color key="Allright" >#77dd77</color>
|
||||
<color key="FgInteresting">#3A6FE4</color>
|
||||
<color key="FgSelectedInteresting">#F0F2FC</color>
|
||||
<color key="FgError">#E74343</color>
|
||||
<color key="FgSelectedError">#FFD7D7</color>
|
||||
<color key="Allright">#77dd77</color>
|
||||
</palette>
|
||||
</skin>
|
||||
<forced-style-palette>false</forced-style-palette>
|
||||
<style-palette>
|
||||
<group id="All">
|
||||
<color role="Base">#373A3D</color>
|
||||
<color role="AlternateBase">#323437</color>
|
||||
<color role="ToolTipBase" brush="Dense1Pattern">#2D2F32</color>
|
||||
<color role="Dark">#202224</color>
|
||||
<color role="Midlight">#292c2e</color>
|
||||
<color role="Mid">#292c2e</color>
|
||||
<color role="Shadow">#292c2e</color>
|
||||
<color role="Light">#323437</color>
|
||||
<color role="Highlight">#8291AD</color>
|
||||
|
||||
<color role="Window" brush="Dense1Pattern">#2D2F32</color>
|
||||
<color role="Button">#323437</color>
|
||||
|
||||
<color role="Text">#D8D8D8</color>
|
||||
<color role="BrightText">#373A3D</color>
|
||||
<color role="HighlightedText">#FFFFFF</color>
|
||||
<color role="PlaceholderText">#A7A7A7</color>
|
||||
<color role="ToolTipText">#D8D8D8</color>
|
||||
<color role="ButtonText">#E7E7E7</color>
|
||||
<color role="WindowText">#D8D8D8</color>
|
||||
<color role="Link">#a1acc1</color>
|
||||
<color role="LinkVisited">#a1acc1</color>
|
||||
|
||||
<color role="NoRole">#2D2F32</color>
|
||||
</group>
|
||||
|
||||
<group id="Disabled">
|
||||
<color role="Text">#999999</color>
|
||||
<color role="ButtonText">#A7A7A7</color>
|
||||
<color role="WindowText">#999999</color>
|
||||
</group>
|
||||
</style-palette>
|
||||
</skin>
|
@ -28,9 +28,9 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
||||
m_ui->m_editorFeedsToolbar->activeItemsWidget()->viewport()->installEventFilter(this);
|
||||
m_ui->m_editorMessagesToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
||||
m_ui->m_editorFeedsToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
||||
m_ui->m_treeSkins->setColumnCount(5);
|
||||
m_ui->m_treeSkins->setColumnCount(4);
|
||||
m_ui->m_treeSkins->setHeaderHidden(false);
|
||||
m_ui->m_treeSkins->setHeaderLabels({ tr("Name"), tr("Version"), tr("Author"), tr("Forced style"), tr("Forced alternative palette") });
|
||||
m_ui->m_treeSkins->setHeaderLabels({ tr("Name"), tr("Author"), tr("Forced style"), tr("Forced alternative palette") });
|
||||
|
||||
m_ui->m_tabUi->setTabVisible(m_ui->m_tabUi->indexOf(m_ui->m_tabTaskBar),
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) || defined(Q_OS_WIN)
|
||||
@ -47,7 +47,6 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(4, QHeaderView::ResizeMode::ResizeToContents);
|
||||
|
||||
connect(m_ui->m_cmbStyles, &QComboBox::currentTextChanged, this, &SettingsGui::updateSkinOptions);
|
||||
|
||||
@ -125,9 +124,9 @@ void SettingsGui::updateSkinOptions() {
|
||||
const Skin skin = it->data(0, Qt::ItemDataRole::UserRole).value<Skin>();
|
||||
const bool skin_has_palette = !skin.m_stylePalette.isEmpty();
|
||||
const bool skin_forces_palette = skin.m_forcedStylePalette;
|
||||
const bool skin_forces_style = skin.m_forcedStyles.isEmpty();
|
||||
const bool skin_forces_style = !skin.m_forcedStyles.isEmpty();
|
||||
|
||||
m_ui->m_cmbStyles->setEnabled(!qApp->skins()->styleIsFrozen() && skin_forces_style);
|
||||
m_ui->m_cmbStyles->setEnabled(!qApp->skins()->styleIsFrozen() && !skin_forces_style);
|
||||
m_ui->m_checkForceAlternativePalette->setEnabled(skin_has_palette
|
||||
? !skin_forces_palette
|
||||
: qApp->skins()->isStyleGoodForAlternativeStylePalette(m_ui->m_cmbStyles->currentText()));
|
||||
@ -204,16 +203,15 @@ void SettingsGui::loadSettings() {
|
||||
for (const Skin& skin : qAsConst(skins)) {
|
||||
QTreeWidgetItem* new_item = new QTreeWidgetItem({
|
||||
skin.m_visibleName,
|
||||
skin.m_version,
|
||||
skin.m_author,
|
||||
skin.m_forcedStyles.isEmpty() ? QString() : skin.m_forcedStyles.join(QSL(", ")),
|
||||
QString() });
|
||||
|
||||
if (skin.m_forcedStyles.isEmpty()) {
|
||||
new_item->setIcon(3, qApp->icons()->fromTheme(QSL("dialog-cancel"), QSL("gtk-cancel")));
|
||||
new_item->setIcon(2, qApp->icons()->fromTheme(QSL("dialog-cancel"), QSL("gtk-cancel")));
|
||||
}
|
||||
|
||||
new_item->setIcon(4, skin.m_forcedStylePalette
|
||||
new_item->setIcon(3, skin.m_forcedStylePalette
|
||||
? qApp->icons()->fromTheme(QSL("dialog-yes"), QSL("dialog-ok"))
|
||||
: qApp->icons()->fromTheme(QSL("dialog-cancel"), QSL("gtk-cancel")));
|
||||
|
||||
|
@ -109,7 +109,7 @@
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="m_checkForceAlternativePalette">
|
||||
<property name="text">
|
||||
<string>Force alternative UI colors defined in skin</string>
|
||||
<string>Force UI colors defined in skin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <QStyle>
|
||||
|
||||
TabBar::TabBar(QWidget* parent) : QTabBar(parent) {
|
||||
setDocumentMode(true);
|
||||
setDocumentMode(false);
|
||||
setUsesScrollButtons(true);
|
||||
setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
|
||||
}
|
||||
|
@ -85,93 +85,11 @@ void SkinFactory::loadSkinFromData(const Skin& skin) {
|
||||
m_currentStyle = qApp->style()->objectName();
|
||||
|
||||
if (isStyleGoodForAlternativeStylePalette(m_currentStyle) &&
|
||||
|
||||
/* Skin has alternative style palette and forces its usage. */
|
||||
((!skin.m_stylePalette.isEmpty() && skin.m_forcedStylePalette) ||
|
||||
|
||||
/* User wants alternative style palette anyway. */
|
||||
qApp->settings()->value(GROUP(GUI), SETTING(GUI::ForceDarkFusion)).toBool())) {
|
||||
!skin.m_stylePalette.isEmpty() &&
|
||||
(skin.m_forcedStylePalette || qApp->settings()->value(GROUP(GUI), SETTING(GUI::ForceDarkFusion)).toBool())) {
|
||||
qDebugNN << LOGSEC_GUI << "Activating alternative palette.";
|
||||
|
||||
QPalette pal;
|
||||
|
||||
if (skin.m_stylePalette.isEmpty()) {
|
||||
QColor clr_maibg(QSL("#2D2F32"));
|
||||
QColor clr_basbg(QSL("#373A3D"));
|
||||
QColor clr_altbg(QSL("#323437"));
|
||||
QColor clr_selbg(QSL("#8291AD"));
|
||||
QColor clr_selfg(QSL("#FFFFFF"));
|
||||
QColor clr_btnfg(QSL("#E7E7E7"));
|
||||
QColor clr_dibfg(QSL("#A7A7A7"));
|
||||
QColor clr_winfg(QSL("#D8D8D8"));
|
||||
QColor clr_diwfg(QSL("#999999"));
|
||||
QColor clr_brdbg(QSL("#202224")); // Use color picker on dark brdr under list header for this one
|
||||
QColor clr_wlink(QSL("#a1acc1"));
|
||||
|
||||
//
|
||||
// Normal state.
|
||||
//
|
||||
|
||||
// Backgrounds & bases.
|
||||
pal.setColor(QPalette::ColorRole::Window, clr_maibg);
|
||||
pal.setColor(QPalette::ColorRole::Base, clr_basbg);
|
||||
pal.setColor(QPalette::ColorRole::Dark, clr_brdbg);
|
||||
pal.setColor(QPalette::ColorRole::AlternateBase, clr_altbg);
|
||||
pal.setColor(QPalette::ColorRole::Button, clr_altbg);
|
||||
pal.setColor(QPalette::ColorRole::Light, clr_altbg);
|
||||
pal.setColor(QPalette::ColorRole::Highlight, clr_selbg);
|
||||
|
||||
// Texts.
|
||||
pal.setColor(QPalette::ColorRole::ButtonText, clr_btnfg);
|
||||
pal.setColor(QPalette::ColorRole::WindowText, clr_winfg);
|
||||
pal.setColor(QPalette::ColorRole::BrightText, clr_basbg);
|
||||
pal.setColor(QPalette::ColorRole::Text, clr_winfg);
|
||||
pal.setColor(QPalette::ColorRole::PlaceholderText, clr_dibfg);
|
||||
pal.setColor(QPalette::ColorRole::Link, clr_wlink);
|
||||
pal.setColor(QPalette::ColorRole::LinkVisited, clr_wlink);
|
||||
pal.setColor(QPalette::ColorRole::HighlightedText, clr_selfg);
|
||||
|
||||
//
|
||||
// Inactive state.
|
||||
//
|
||||
|
||||
// Backgrounds & bases.
|
||||
|
||||
// Texts.
|
||||
|
||||
//
|
||||
// Disabled state.
|
||||
//
|
||||
|
||||
// Backgrounds & bases.
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Window, clr_maibg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Base, clr_basbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Dark, clr_brdbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::AlternateBase, clr_altbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Button, clr_altbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Light, clr_altbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Highlight, clr_selbg);
|
||||
|
||||
// Texts.
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText, clr_dibfg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::WindowText, clr_diwfg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::BrightText, clr_basbg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Text, clr_diwfg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::PlaceholderText, clr_dibfg);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::Link, clr_wlink);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::LinkVisited, clr_wlink);
|
||||
pal.setColor(QPalette::ColorGroup::Disabled, QPalette::ColorRole::HighlightedText, clr_selfg);
|
||||
|
||||
//
|
||||
// Tooltips.
|
||||
//
|
||||
|
||||
pal.setColor(QPalette::ColorGroup::All, QPalette::ColorRole::ToolTipBase, clr_maibg);
|
||||
pal.setColor(QPalette::ColorGroup::All, QPalette::ColorRole::ToolTipText, clr_winfg);
|
||||
}
|
||||
else {
|
||||
pal = skin.extractPalette();
|
||||
}
|
||||
QPalette pal = skin.extractPalette();
|
||||
|
||||
QToolTip::setPalette(pal);
|
||||
qApp->setPalette(pal);
|
||||
@ -312,10 +230,12 @@ Skin SkinFactory::skinInfo(const QString& skin_name, bool* ok) const {
|
||||
|
||||
if (!style_palette_root.isNull()) {
|
||||
const QMetaObject& mop = QPalette::staticMetaObject;
|
||||
QMetaEnum enumerp = mop.enumerator(mop.indexOfEnumerator(QSL("ColorGroup").toLocal8Bit().constData()));
|
||||
QMetaEnum enumerx = mop.enumerator(mop.indexOfEnumerator(QSL("ColorRole").toLocal8Bit().constData()));
|
||||
|
||||
QMultiHash<QPalette::ColorGroup, QPair<QPalette::ColorRole, QColor>> groups;
|
||||
QMetaEnum enumerp = QMetaEnum::fromType<QPalette::ColorGroup>();
|
||||
QMetaEnum enumerx = QMetaEnum::fromType<QPalette::ColorRole>();
|
||||
QMetaEnum enumery = QMetaEnum::fromType<Qt::BrushStyle>();
|
||||
|
||||
QMultiHash<QPalette::ColorGroup, QPair<QPalette::ColorRole, QPair<QColor, Qt::BrushStyle>>> groups;
|
||||
|
||||
QDomNodeList groups_of_palette = style_palette_root.elementsByTagName(QSL("group"));
|
||||
|
||||
@ -330,8 +250,10 @@ Skin SkinFactory::skinInfo(const QString& skin_name, bool* ok) const {
|
||||
|
||||
QColor color(color_nd.toElement().text());
|
||||
QPalette::ColorRole role = QPalette::ColorRole(enumerx.keyToValue(color_nd.toElement().attribute(QSL("role")).toLatin1()));
|
||||
Qt::BrushStyle brush = Qt::BrushStyle(enumery.keyToValue(color_nd.toElement().attribute(QSL("brush")).toLatin1()));
|
||||
|
||||
groups.insert(group, QPair<QPalette::ColorRole, QColor>(role, color));
|
||||
groups.insert(group, QPair<QPalette::ColorRole, QPair<QColor, Qt::BrushStyle>>(role,
|
||||
{ color, brush }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,7 +397,12 @@ QPalette Skin::extractPalette() const {
|
||||
auto roles = m_stylePalette.values(grp);
|
||||
|
||||
for (const auto& rl : roles) {
|
||||
pal.setColor(grp, rl.first, rl.second);
|
||||
if (rl.second.second <= 0) {
|
||||
pal.setColor(grp, rl.first, rl.second.first);
|
||||
}
|
||||
else {
|
||||
pal.setBrush(grp, rl.first, QBrush(rl.second.first, rl.second.second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ struct RSSGUARD_DLLSPEC Skin {
|
||||
QHash<SkinEnums::PaletteColors, QColor> m_colorPalette;
|
||||
QStringList m_forcedStyles;
|
||||
bool m_forcedStylePalette;
|
||||
QMultiHash<QPalette::ColorGroup, QPair<QPalette::ColorRole, QColor>> m_stylePalette;
|
||||
QMultiHash<QPalette::ColorGroup, QPair<QPalette::ColorRole, QPair<QColor, Qt::BrushStyle>>> m_stylePalette;
|
||||
|
||||
QVariant colorForModel(SkinEnums::PaletteColors type, bool ignore_custom_colors = false) const;
|
||||
QPalette extractPalette() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user