Reduced hard coded stylesheet values

* disabled hardcoded wizard pages style sheet
* adjusted style sheet
* fixed QMneu issue: https://stackoverflow.com/questions/53991839/qt-5-12-menu-items-with-unwanted-extra-space
* tagged remaining ones as "\fixme hardcoded"
This commit is contained in:
Klaus Basan
2019-01-02 06:53:59 +01:00
committed by Mat Sutcliffe
parent cd095dbb3f
commit 2de192600f
4 changed files with 16 additions and 7 deletions

View File

@@ -61,12 +61,15 @@ namespace BlackGui
// init if data already available // init if data already available
this->onWebDataRead(); this->onWebDataRead();
// \fixme setting per stylesheet does NOT work, this hardcoded stuff should be removed /**
//! \todo remove this block when no longer needed after 2019-02
//! \fixme hardcoded stylesheet setting per stylesheet does NOT work, this hardcoded stuff should be removed
const QString style("background-image: url(:/textures/icons/textures/texture-inner.jpg)"); const QString style("background-image: url(:/textures/icons/textures/texture-inner.jpg)");
ui->wp2_Aircraft->setStyleSheet(style); ui->wp2_Aircraft->setStyleSheet(style);
ui->wp3_LiveryColor->setStyleSheet(style); ui->wp3_LiveryColor->setStyleSheet(style);
ui->wp4_Livery->setStyleSheet(style); ui->wp4_Livery->setStyleSheet(style);
ui->wp5_Distributor->setStyleSheet(style); ui->wp5_Distributor->setStyleSheet(style);
**/
} }
CDbQuickMappingWizard::~CDbQuickMappingWizard() CDbQuickMappingWizard::~CDbQuickMappingWizard()

View File

@@ -258,12 +258,15 @@ namespace BlackGui
BLACK_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox"); BLACK_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox");
if (!checkBox) { return; } if (!checkBox) { return; }
static const QString background("background: rgba(40,40,40)"); //! \todo hardcoded, should come from stylesheet static const QString background("background: rgba(40,40,40)"); //! \fixme hardcoded stylesheet setting, should come from stylesheet
if (readOnly) if (readOnly)
{ {
checkBox->setAttribute(Qt::WA_TransparentForMouseEvents); checkBox->setAttribute(Qt::WA_TransparentForMouseEvents);
checkBox->setFocusPolicy(Qt::NoFocus); checkBox->setFocusPolicy(Qt::NoFocus);
checkBox->setStyleSheet(background);
// without that, the checkboxes appear not readonly
// obviously style sheet only does not work
checkBox->setStyleSheet(background); //! fixme hardcoded stylesheet setting
} }
else else
{ {

View File

@@ -24,6 +24,7 @@ QCheckBox {
/* CGuiUtility::checkBoxReadOnly */ /* CGuiUtility::checkBoxReadOnly */
/* used for read-only checkboxes */ /* used for read-only checkboxes */
/* QCheckBox[readOnly="true"] { background: rgba(40,40,40); } */
QCheckBox::indicator { QCheckBox::indicator {
color: #b1b1b1; color: #b1b1b1;
@@ -194,6 +195,8 @@ BlackGui--Components--CRawFsdMessagesDialog,
BlackGui--Components--CDbOwnModelsDialog, BlackGui--Components--CDbOwnModelsDialog,
BlackGui--Components--CDbOwnModelSetDialog, BlackGui--Components--CDbOwnModelSetDialog,
BlackGui--Components--CFirstModelSetComponent, BlackGui--Components--CFirstModelSetComponent,
BlackGui--Components--CDbAircraftIcaoComponent,
BlackGui--Components--CDbLiveryComponent,
BlackGui--Components--CDbDistributorComponent, BlackGui--Components--CDbDistributorComponent,
BlackGui--Components--CLegalInfoComponent BlackGui--Components--CLegalInfoComponent
{ {
@@ -473,9 +476,9 @@ QMenu {
padding: 5px; padding: 5px;
} }
QMenu::item { /* until Qt 5.12 needed, now since Qt 5.12 causing issue
padding: 4px 25px 4px 20px; QMenu::item { padding: 4px 25px 4px 20px; }
} **/
/* fix margin style */ /* fix margin style */
QMenu > QFrame { QMenu > QFrame {

View File

@@ -156,7 +156,7 @@ namespace BlackGui
const QString f = fileInfo.fileName().toLower(); const QString f = fileInfo.fileName().toLower();
// keep even empty files as placeholders // keep even empty files as placeholders
newStyleSheets.insert(f, c); newStyleSheets.insert(f, c); // set an empty string here to disable all stylesheet
} }
file.close(); file.close();
} }