Default stylesheets revision + clean-up (#13772)

* Added the new QSS file with images

Added the new QSS file with images

* fixed some disabled colors to be the same everywhere.

* update

* big update fixed the scrollbars and lots more.

* small tweaks

* small fixes

* fixed groupbox in qsint

* Added light classic

This light theme is basicallyt exactly no-stylesheet.

* fixed the tabs

* fixed background reportview

* updated overlay stylesheets

* Added preference settings from Opentheme @obelisk79

* tabbar tweaks

* forgot the gradients on dark

* Overlay stylesheets clean-up +move icon to folder.

* removing old stylesheets

removing old stylesheets

* it was icons not icon, fixed it.

* updated cmake and package.xml

* to many spaces

* removing old theme's

* updated default overlay qss

* removed my settings files

* updated cfg files

* Bunch of fixes

I compiled it and didn't see any issues anymore. Could be some discussions about the new startpage thumbnails.

* fixed up double arrows and the correct logo!

* updated the work file for the icons

* Sets no-stylesheet overlay to a stylesheet.

* type in cmakelist

* type in filename

* oeps did set the dark theme

* Update OverlayManager.cpp

I removed a bit to much reverting this line

* fixed text color issue in Qsint on the light theme and dark background

* Update Light Theme + Dark Background.qss

Fine tuning the treeview it now works good for ligth theme and dark brackgrounds.

* removed prodark added back Behave dark overlay

@Syres916 I deleted the overlay qss behave dark by accident.
But you might want to check this PR out since it changes a lot.

I deleted Pro-dark since it was not updated and is outdated and it looks also a lot like the default dark.

* Update Light Theme + Light Background.qss

Fixes

* small fixes

small fixes

* remove ProDark

* Update CMakeLists.txt

* changed the thumbnails

Also removed teh dimensions in the filename since that got annoying real fast :)

* Updated other overlay stylesheets

* missing extension

* cleanup and some fixes to the overlay.

* Update Dark Theme + Light Background.qss

udpated the dark theme overaly with light background for all you maniacs who use this.

* Title bar fix for windows

This makes it so that it uses black title bar in windows if you have dark mode

* updated white background and some colors

* I think I fix merge issue now.

* Some cleanup on the thumbnails

* Create CMakePresets.json

* idk

* trying to fix conflicts

* removing old themes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Some fixes for Qsint sketcher toolbars icons

* fixed merge issue with maingui

* trying to fix merge conflicts

* and removing again.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
MisterMaker
2024-06-14 05:13:05 +02:00
committed by GitHub
parent 5594d23b5a
commit 7a80632a4e
220 changed files with 9327 additions and 17192 deletions

View File

@@ -78,7 +78,7 @@ static inline OverlayTabWidget *findTabWidget(QWidget *widget=nullptr, bool filt
widget = qApp->focusWidget();
for(auto w=widget; w; w=w->parentWidget()) {
auto tabWidget = qobject_cast<OverlayTabWidget*>(w);
if(tabWidget)
if(tabWidget)
return tabWidget;
auto proxy = qobject_cast<OverlayProxyWidget*>(w);
if(proxy)
@@ -95,7 +95,7 @@ public:
OverlayStyleSheet() {
handle = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/MainWindow");
update();
handle->Attach(this);
@@ -146,18 +146,18 @@ private:
if (overlayStyleSheet.isEmpty()) {
// User did not choose any stylesheet, we need to choose one based on main stylesheet
if (mainStyleSheet.contains(QStringLiteral("light"), Qt::CaseInsensitive)) {
overlayStyleSheet = QStringLiteral("overlay:Light-Outline.qss");
overlayStyleSheet = QStringLiteral("overlay:Light Theme + Dark Background.qss");
}
else {
// by default FreeCAD uses somewhat dark background for 3D View.
// if user has not explicitly selected light theme, the "Dark Outline" looks best
overlayStyleSheet = QStringLiteral("overlay:Dark-Outline.qss");
overlayStyleSheet = QStringLiteral("overlay:Dark Theme + Dark Background.qss");
}
}
else if (!overlayStyleSheet.isEmpty() && !QFile::exists(overlayStyleSheet)) {
// User did choose one of predefined stylesheets, we need to qualify it with namespace
overlayStyleSheet = QStringLiteral("overlay:%1").arg(overlayStyleSheet);
}
overlayStyleSheet = QStringLiteral("overlay:%1").arg(overlayStyleSheet);
}
return overlayStyleSheet;
}
@@ -177,70 +177,7 @@ private:
static const QString _default;
};
const QString OverlayStyleSheet::_default = QStringLiteral(
"* {alternate-background-color: rgba(250,250,250,120)}"
"QComboBox, QComboBox:editable, QComboBox:!editable, QLineEdit,"
"QTextEdit, QPlainTextEdit, QAbstractSpinBox, QDateEdit, QDateTimeEdit,"
"Gui--PropertyEditor--PropertyEditor QLabel "
"{background : palette(base);}"
"QScrollBar { background: rgba(0,0,0,10);}"
"QTabWidget::pane { background-color: transparent; border: transparent }"
"Gui--OverlayTabWidget { qproperty-effectColor: rgba(0,0,0,0) }"
"Gui--OverlayTabWidget::pane { background-color: rgba(250,250,250,80) }"
"QTabBar {border : none;}"
"QTabBar::tab {color: palette(text);"
"background-color: rgba(100,100,100,50);"
"padding: 5px}"
"QTabBar::tab:selected {background-color: rgba(250,250,250,80);}"
"QTabBar::tab:hover {background-color: rgba(250,250,250,200);}"
"QHeaderView { background:transparent }"
"QHeaderView::section {color: palette(text);"
"background-color: rgba(250,250,250,50);"
"border: 1px solid palette(dark);"
"padding: 2px}"
"QTreeView, QListView, QTableView {"
"background: rgb(250,250,250);"
"border: transparent;"
"selection-background-color: rgba(94, 144, 250, 0.7);}"
"QListView::item:selected, QTreeView::item:selected {"
"background-color: rgba(94, 144, 250, 0.7);}"
"Gui--PropertyEditor--PropertyEditor {"
"border: 1px solid palette(dark);"
"qproperty-groupTextColor: rgb(100, 100, 100);"
"qproperty-groupBackground: rgba(180, 180, 180, 0.7);}"
"QToolTip {background-color: rgba(250,250,250,180);}"
"Gui--TreeWidget QHeaderView:section {"
"height: 0px;"
"background-color: transparent;"
"padding: 0px;"
"border: transparent;}"
"Gui--CallTipsList::item { background-color: rgba(200,200,200,200);}"
"Gui--CallTipsList::item::selected { background-color: palette(highlight);}"
"QPushButton { background: rgba(250,250,250,80);padding: 2px 4px;}"
"QPushButton::hover { background: rgba(250,250,250,200);}"
"QPushButton::focus { background: rgba(250,250,250,255);}"
"QPushButton::pressed { background-color: #5e90fa;"
"border: 1px inset palette(dark) }"
"QPushButton::checked { background: rgba(100,100,100,100);"
"border: 1px inset palette(dark) }"
"QPushButton::checked:hover { background: rgba(150,150,150,200);"
"border: 1px inset palette(dark) }"
"Gui--OverlayToolButton { background: transparent; padding: 0px; border: none }"
"Gui--OverlayTitleBar,"
"Gui--OverlaySplitterHandle { background-color: rgba(200, 200, 200, 150); }"
"QWidget#ClippingScrollAreaContents, "
"QScrollArea#ClippingScrollArea { border: none; background-color: #a0e6e6e6; }"
"Gui--PropertyEditor--PropertyEditor > QWidget > QPushButton {text-align:left;padding-left:2px;}"
const QString OverlayStyleSheet::_default = QStringLiteral("overlay:Light Theme + Dark Background.qss"
);
// -----------------------------------------------------------
@@ -270,7 +207,7 @@ struct OverlayInfo {
if (hGrp == Param && Name && !tabWidget->isSaving()) {
// This will prevent saving settings which will mess up the
// just restored ones
tabWidget->restore(nullptr);
tabWidget->restore(nullptr);
OverlayManager::instance()->reload();
}
});
@@ -411,7 +348,7 @@ public:
,_overlayInfos({&_left,&_right,&_top,&_bottom})
,_actions({&_actOverlay,&_actFloat,&_actClose})
{
_Overlays = {OverlayTabWidget::_LeftOverlay,
_Overlays = {OverlayTabWidget::_LeftOverlay,
OverlayTabWidget::_RightOverlay,
OverlayTabWidget::_TopOverlay,
OverlayTabWidget::_BottomOverlay};
@@ -465,9 +402,9 @@ public:
void refreshIcons()
{
_actFloat.setIcon(BitmapFactory().pixmap("qss:overlay/float.svg"));
_actOverlay.setIcon(BitmapFactory().pixmap("qss:overlay/overlay.svg"));
_actClose.setIcon(BitmapFactory().pixmap("qss:overlay/close.svg"));
_actFloat.setIcon(BitmapFactory().pixmap("qss:overlay/icons/float.svg"));
_actOverlay.setIcon(BitmapFactory().pixmap("qss:overlay/icons/overlay.svg"));
_actClose.setIcon(BitmapFactory().pixmap("qss:overlay/icons/close.svg"));
for (OverlayTabWidget *tabWidget : _Overlays) {
tabWidget->refreshIcons();
for (auto handle : tabWidget->findChildren<OverlaySplitterHandle*>())
@@ -610,7 +547,7 @@ public:
updateFocus = true;
else if(o->tabWidget == active)
updateActive = true;
else
else
o->tabWidget->setOverlayMode(true);
}
if(!o->tabWidget->getRevealTime().isNull()) {
@@ -628,12 +565,12 @@ public:
focus->raise();
if(reveal == focus)
reveal = nullptr;
} else
} else
focus->updateSplitterHandles();
}
if(active) {
if(active != focus && (active->isOverlaid(OverlayTabWidget::QueryOption::TransparencyChanged) || updateActive))
if(active != focus && (active->isOverlaid(OverlayTabWidget::QueryOption::TransparencyChanged) || updateActive))
active->setOverlayMode(false);
active->raise();
if(reveal == active)
@@ -646,7 +583,7 @@ public:
}
for(auto o : _overlayInfos) {
if(o->tabWidget != focus
if(o->tabWidget != focus
&& o->tabWidget != active
&& o->tabWidget != reveal
&& o->tabWidget->count()
@@ -703,7 +640,7 @@ public:
_bottom.tabWidget->setRect(QRect(ofs.width(),h-rect.height(),bw,rect.height()));
if (_bottom.tabWidget->count()
&& _bottom.tabWidget->isVisible()
&& _bottom.tabWidget->isVisible()
&& _bottom.tabWidget->getState() <= OverlayTabWidget::State::Normal)
rectBottom = _bottom.tabWidget->getRect();
@@ -722,7 +659,7 @@ public:
_left.tabWidget->setRect(QRect(ofs.height(),ofs.width(),rect.width(),lh));
if (_left.tabWidget->count()
&& _left.tabWidget->isVisible()
&& _left.tabWidget->isVisible()
&& _left.tabWidget->getState() <= OverlayTabWidget::State::Normal)
rectLeft = _left.tabWidget->getRect();
@@ -742,7 +679,7 @@ public:
_right.tabWidget->setRect(QRect(w-rect.width(),ofs.width(),rect.width(),rh));
if (_right.tabWidget->count()
&& _right.tabWidget->isVisible()
&& _right.tabWidget->isVisible()
&& _right.tabWidget->getState() <= OverlayTabWidget::State::Normal)
rectRight = _right.tabWidget->getRect();
@@ -1030,7 +967,7 @@ public:
dock->show();
dock->setFloating(true);
refresh();
} else
} else
dock->setFloating(!dock->isFloating());
}
return;
@@ -1220,7 +1157,7 @@ public:
resizeOffset = -1;
++i;
}
else
else
rect.setHeight(size/2);
}
else if (pos.x() > pt.x() + size/2) {
@@ -1480,7 +1417,7 @@ public:
void unregisterDockWidget(const QString &name, OverlayTabWidget *widget) {
auto it = _dockWidgetNameMap.find(name);
if (it != _dockWidgetNameMap.end() && it->second == widget)
if (it != _dockWidgetNameMap.end() && it->second == widget)
_dockWidgetNameMap.erase(it);
}
@@ -2024,7 +1961,7 @@ void OverlayManager::Private::interceptEvent(QWidget *widget, QEvent *ev)
case QEvent::ContextMenu: {
auto ce = static_cast<QContextMenuEvent*>(ev);
lastIntercept = getChildAt(widget, ce->globalPos());
QContextMenuEvent contextMenuEvent(ce->reason(),
QContextMenuEvent contextMenuEvent(ce->reason(),
lastIntercept->mapFromGlobal(ce->globalPos()),
ce->globalPos());
QApplication::sendEvent(lastIntercept, &contextMenuEvent);