Skip to content

Commit

Permalink
Remove vestigial highdpi stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmassay committed Jul 29, 2024
1 parent 8535217 commit 3c011bd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 83 deletions.
33 changes: 1 addition & 32 deletions AppearanceWidget.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
**
** Copyright (C) 2019-2024 Kevin B. Hendricks, Stratford Ontario Canada
** Copyright (C) 2019-2020 Doug Massay
** Copyright (C) 2019-2024 Doug Massay
** Copyright (C) 2012 John Schember <[email protected]>
** Copyright (C) 2012 Grant Drake
**
Expand Down Expand Up @@ -36,10 +36,7 @@
#include "Utility.h"

AppearanceWidget::AppearanceWidget()
: m_isHighDPIComboEnabled(false)
{
// Disable the HighDPI combobox on all platforms under Qt6
m_isHighDPIComboEnabled = false;

ui.setupUi(this);

Expand All @@ -48,19 +45,6 @@ AppearanceWidget::AppearanceWidget()
ui.grpCustomDarkStyle->setVisible(false);
#endif

// setup the HighDPI combo box here
ui.comboHighDPI->addItems({tr("Detect"), tr("On"), tr("Off")});
QString highdpi_tooltip = "<p><dt><b>" + tr("Detect") + "</b><dd>" + tr("Detect whether any high dpi scaling should take place.");
highdpi_tooltip += " " + tr("Defers to any Qt environment variables that are set to control high dpi behavior.") + "</dd>";
highdpi_tooltip += "<dt><b>" + tr("On") + "</b><dd>" + tr("Turns on high dpi scaling and ignores any Qt environment variables");
highdpi_tooltip += " " + tr("that are set controlling high dpi behavior.") + "</dd>";
highdpi_tooltip += "<dt><b>" + tr("Off") + "</b><dd>" + tr("Turns off high dpi scaling regardless if any Qt environment");
highdpi_tooltip += " " + tr("variables controlling high dpi behavior are set.") + "</dd>";
ui.comboHighDPI->setToolTip(highdpi_tooltip);

// The HighDPI setting is unused/unnecessary on Mac
ui.comboHighDPI->setEnabled(m_isHighDPIComboEnabled);

m_uiFontResetFlag = false;

readSettings();
Expand All @@ -74,10 +58,6 @@ PreferencesWidget::ResultActions AppearanceWidget::saveSettings()
settings.setPreviewDark(ui.PreviewDarkInDM->isChecked() ? 1 : 0);
// This setting has no effect on other OSes, but it won't hurt to set it.
settings.setUiUseCustomDarkTheme(ui.chkDarkStyle->isChecked() ? 1 : 0);
// Don't try to get the index of a disabled combobox
if (m_isHighDPIComboEnabled) {
settings.setHighDPI(ui.comboHighDPI->currentIndex());
}
settings.setUIFont(m_currentUIFont);

SettingsStore::WebViewAppearance WVAppearance;
Expand Down Expand Up @@ -109,12 +89,6 @@ PreferencesWidget::ResultActions AppearanceWidget::saveSettings()
if (m_PreviewDark != (ui.PreviewDarkInDM->isChecked() ? 1 : 0)) {
results = results | PreferencesWidget::ResultAction_ReloadPreview;
}
// Don't try to get the index of a disabled combobox
if (m_isHighDPIComboEnabled) {
if (m_HighDPI != (ui.comboHighDPI->currentIndex())) {
results = results | PreferencesWidget::ResultAction_RestartPageEdit;
}
}
if ((m_currentUIFont != m_initUIFont) || m_uiFontResetFlag) {
results = results | PreferencesWidget::ResultAction_RestartPageEdit;
}
Expand Down Expand Up @@ -148,11 +122,6 @@ void AppearanceWidget::readSettings()
ui.webViewFontSizeSpin->setValue(WVAppearance.font_size);
ui.specialCharacterFontSizeSpin->setValue(specialCharacterAppearance.font_size);
ui.iconSizeSlider->setValue(int(settings.mainMenuIconSize()*10));
// Don't try to set the index of a disabled combobox
if (m_isHighDPIComboEnabled) {
m_HighDPI = settings.highDPI();
ui.comboHighDPI->setCurrentIndex(m_HighDPI);
}
if (!settings.uiFont().isEmpty()) {
m_initUIFont = settings.uiFont();
} else {
Expand Down
2 changes: 0 additions & 2 deletions AppearanceWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ private slots:
void connectSignalsToSlots();

Ui::AppearanceWidget ui;
int m_HighDPI;
int m_PreviewDark;
QString m_initUIFont;
QString m_currentUIFont;
bool m_isHighDPIComboEnabled;
bool m_uiFontResetFlag;
bool m_UseCustomDarkTheme;
};
Expand Down
32 changes: 0 additions & 32 deletions PAppearanceWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -313,38 +313,6 @@ if a sans-serif font-family specified in your CSS</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpHighDPI">
<property name="title">
<string>High DPI Setting:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboHighDPI"/>
</item>
<item>
<widget class="QLabel" name="lblHighDPIWarn">
<property name="text">
<string>(Needs PageEdit Restart)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>105</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="uifontGroup">
<property name="title">
Expand Down
13 changes: 0 additions & 13 deletions SettingsStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ static QString KEY_UI_FONT = SETTINGS_GROUP + "/" + "ui_font";
static QString KEY_ORIGINAL_UI_FONT = SETTINGS_GROUP + "/" + "original_ui_font";
static QString KEY_UI_CUSTOM_DARK_THEME = SETTINGS_GROUP + "/" + "ui_custom_dark_theme";

static QString KEY_HIGHDPI_SETTING = SETTINGS_GROUP + "/" + "high_dpi";
static QString KEY_DISABLEGPU_SETTING = SETTINGS_GROUP + "/" + "disable_gpu";
static QString KEY_PREVIEW_DARK_IN_DM = SETTINGS_GROUP + "/" + "preview_dark_in_dm";
static QString KEY_PRINT_PREVIEW_DPI_SETTING = SETTINGS_GROUP + "/" + "print_preview_dpi";
Expand Down Expand Up @@ -107,12 +106,6 @@ QString SettingsStore::originalUIFont()
return value(KEY_ORIGINAL_UI_FONT, "").toString();
}

int SettingsStore::highDPI()
{
clearSettingsGroup();
return value(KEY_HIGHDPI_SETTING, 0).toInt();
}

bool SettingsStore::disableGPU()
{
clearSettingsGroup();
Expand Down Expand Up @@ -274,12 +267,6 @@ void SettingsStore::setOriginalUIFont(const QString &font_data)
setValue(KEY_ORIGINAL_UI_FONT, font_data);
}

void SettingsStore::setHighDPI(int value)
{
clearSettingsGroup();
setValue(KEY_HIGHDPI_SETTING, value);
}

void SettingsStore::setDisableGPU(bool value)
{
clearSettingsGroup();
Expand Down
6 changes: 2 additions & 4 deletions SettingsStore.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/************************************************************************
**
** Copyright (C) 2019-2023 Kevin B. Hendricks, Stratford, Ontario, Canada
** Copyright (C) 2016-2024 Kevin B. Hendricks, Stratford, ON
** Copyright (C) 2016-2024 Doug Massay
** Copyright (C) 2011-2013 John Schember <[email protected]>
** Copyright (C) 2012-2013 Dave Heiland
**
Expand Down Expand Up @@ -57,8 +58,6 @@ class SettingsStore : public QSettings

QString originalUIFont();

int highDPI();

bool disableGPU();

int previewDark();
Expand Down Expand Up @@ -147,7 +146,6 @@ public slots:

void setOriginalUIFont(const QString &font_data);

void setHighDPI(int value);

void setDisableGPU(bool value);

Expand Down

0 comments on commit 3c011bd

Please sign in to comment.