-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attach Widget Focus UI prefs to settings store [deploy]
- Loading branch information
1 parent
4efdc7a
commit 51dcfdf
Showing
4 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/************************************************************************ | ||
** | ||
** Copyright (C) 2016-2021 Kevin B. Hendricks, Stratford, ON | ||
** Copyright (C) 2016-2020 Doug Massay | ||
** Copyright (C) 2016-2024 Doug Massay | ||
** Copyright (C) 2011-2013 John Schember <[email protected]> | ||
** Copyright (C) 2012-2013 Grant Drake | ||
** | ||
|
@@ -145,6 +145,7 @@ PreferencesWidget::ResultActions AppearanceWidget::saveSettings() | |
settings.setAppearancePrefsTabIndex(ui.tabAppearance->currentIndex()); | ||
settings.setShowFullPathOn(ui.ShowFullPath->isChecked() ? 1 : 0); | ||
settings.setPreviewDark(ui.PreviewDarkInDM->isChecked() ? 1 : 0); | ||
settings.setUIHighlightFocusWidget(ui.chkFocusDec->isChecked() ? 1 : 0); | ||
// handle icon theme | ||
QString icon_theme = "main"; | ||
if (ui.Fluent->isChecked()) { | ||
|
@@ -262,6 +263,10 @@ PreferencesWidget::ResultActions AppearanceWidget::saveSettings() | |
if ((m_currentUIFont != m_initUIFont) || m_uiFontResetFlag) { | ||
results = results | PreferencesWidget::ResultAction_RestartSigil; | ||
} | ||
// if show widget focus highlight pref changed, set need for restart | ||
if (m_ShowWidgetFocus != (ui.chkFocusDec->isChecked() ? 1 : 0)) { | ||
results = results | PreferencesWidget::ResultAction_RestartSigil; | ||
} | ||
m_uiFontResetFlag = false; | ||
results = results & PreferencesWidget::ResultAction_Mask; | ||
return results; | ||
|
@@ -273,6 +278,8 @@ SettingsStore::CodeViewAppearance AppearanceWidget::readSettings() | |
ui.tabAppearance->setCurrentIndex(settings.appearancePrefsTabIndex()); | ||
m_ShowFullPathOn = settings.showFullPathOn(); | ||
ui.ShowFullPath->setChecked(settings.showFullPathOn()); | ||
m_ShowWidgetFocus = settings.uiHighlightFocusWidgetEnabled(); | ||
ui.chkFocusDec->setChecked(settings.uiHighlightFocusWidgetEnabled()); | ||
|
||
// Handle Icon Theme | ||
QString icon_theme = settings.uiIconTheme(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/************************************************************************ | ||
** | ||
** Copyright (C) 2019-2021 Kevin B. Hendricks, Stratford, Ontario Canada | ||
** Copyright (C) 2020 Doug Massay | ||
** Copyright (C) 2016-2024 Doug Massay | ||
** Copyright (C) 2012 John Schember <[email protected]> | ||
** Copyright (C) 2012 Grant Drake | ||
** | ||
|
@@ -62,6 +62,7 @@ private slots: | |
int m_ShowFullPathOn; | ||
int m_HighDPI; | ||
int m_DragTweak; | ||
bool m_ShowWidgetFocus; | ||
int m_PreviewDark; | ||
bool m_wasDark; | ||
QString m_initUIFont; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/************************************************************************ | ||
** | ||
** Copyright (C) 2016-2024 Kevin B. Hendricks, Stratford, ON | ||
** Copyright (C) 2016-2023 Doug Massay | ||
** Copyright (C) 2016-2024 Doug Massay | ||
** Copyright (C) 2011-2013 John Schember <[email protected]> | ||
** Copyright (C) 2012-2013 Dave Heiland | ||
** | ||
|
@@ -946,6 +946,7 @@ void SettingsStore::clearAppearanceSettings() | |
remove(KEY_UI_ICON_THEME); | ||
remove(KEY_DRAG_DISTANCE_TWEAK); | ||
remove(KEY_PREVIEW_DARK_IN_DM); | ||
remove(KEY_UI_HIGHLIGHT_FOCUS_WIDGET); | ||
; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/************************************************************************ | ||
** | ||
** Copyright (C) 2018-2023 Kevin B. Hendricks, Stratford Ontario Canada | ||
** Copyright (C) 2019-2022 Doug Massay | ||
** Copyright (C) 2019-2024 Doug Massay | ||
** Copyright (C) 2009-2011 Strahinja Markovic <[email protected]> | ||
** | ||
** This file is part of Sigil. | ||
|
@@ -655,12 +655,8 @@ int main(int argc, char *argv[]) | |
// End of UI font stuff | ||
|
||
// allow user to highlight focus widget | ||
QString focus_highlight = Utility::GetEnvironmentVar("SIGIL_HIGHLIGHT_FOCUS_WIDGET"); | ||
if (focus_highlight.isEmpty()) { | ||
settings.setUIHighlightFocusWidget(false); | ||
} else { | ||
settings.setUIHighlightFocusWidget(true); | ||
QString current_stylesheet = app.styleSheet(); | ||
if (settings.uiHighlightFocusWidgetEnabled()) { | ||
QString current_stylesheet = app.styleSheet(); | ||
current_stylesheet.append(":focus { border: 1px solid red; } }"); | ||
app.setStyleSheet(current_stylesheet); | ||
} | ||
|
51dcfdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried it on my mac, and it works like a charm! Thank you.
51dcfdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
51dcfdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They seem fine to me!