Force a uniform style for group boxes, on Mac non-flat works better, on Linux flat is standard

This commit is contained in:
Stephan Witt 2020-08-07 10:54:12 +02:00
parent 0fa4b7e736
commit 3af8ff39fc
2 changed files with 19 additions and 0 deletions

View File

@ -95,6 +95,7 @@
#include <QDropEvent>
#include <QFuture>
#include <QFutureWatcher>
#include <QGroupBox>
#include <QLabel>
#include <QList>
#include <QMenu>
@ -4786,6 +4787,19 @@ void GuiView::resetDialogs()
}
void GuiView::flatGroupBoxes(const QObject * widget, bool flag)
{
for (const QObject * child: qAsConst(widget->children())) {
if (child->inherits("QGroupBox")) {
QGroupBox * box = (QGroupBox*) child;
box->setFlat(flag);
} else {
flatGroupBoxes(child, flag);
}
}
}
Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
{
if (!isValidName(name))
@ -4801,6 +4815,9 @@ Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
Dialog * dialog = build(name);
d.dialogs_[name].reset(dialog);
// Force a uniform style for group boxes
// On Mac non-flat works better, on Linux flat is standard
flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
if (lyxrc.allow_geometry_session)
dialog->restoreSession();
if (hide_it)

View File

@ -236,6 +236,8 @@ private Q_SLOTS:
///
void resetWindowTitle();
void flatGroupBoxes(const QObject * object, bool flag);
///
void checkCancelBackground();
///