Skip to content

Commit

Permalink
move tab focus fixes into ui files wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhendricks committed Apr 18, 2024
1 parent 2dcc067 commit 829b457
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 142 deletions.
2 changes: 1 addition & 1 deletion src/Dialogs/EditTOC.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
**
** Copyright (C) 2016-2021 Kevin B. Hendricks, Stratford, Ontario, Canada
** Copyright (C) 2016-2024 Kevin B. Hendricks, Stratford, Ontario, Canada
** Copyright (C) 2013 Dave Heiland
**
** This file is part of Sigil.
Expand Down
7 changes: 0 additions & 7 deletions src/Dialogs/HeadingSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ HeadingSelector::HeadingSelector(QSharedPointer<Book> book, QWidget *parent)
PopulateSelectHeadingCombo(GetMaxHeadingLevel(flat_headings));
RefreshTOCModelDisplay();
ReadSettings();
ui.tvTOCDisplay->setFocusPolicy(Qt::StrongFocus);
ui.rename->setFocusPolicy(Qt::StrongFocus);
ui.bleft->setFocusPolicy(Qt::StrongFocus);
ui.bright->setFocusPolicy(Qt::StrongFocus);
ui.cbTOCItemsOnly->setFocusPolicy(Qt::StrongFocus);
ui.cbTOCSetHeadingLevel->setFocusPolicy(Qt::StrongFocus);
ui.buttonBox->setFocusPolicy(Qt::StrongFocus);
}


Expand Down
3 changes: 0 additions & 3 deletions src/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ KeyboardShortcutsWidget::KeyboardShortcutsWidget()
ui.setupUi(this);
connectSignalsSlots();
readSettings();
ui.resetAllButton->setFocusPolicy(Qt::ClickFocus);
ui.assignButton->setFocusPolicy(Qt::StrongFocus);
ui.removeButton->setFocusPolicy(Qt::StrongFocus);
}

PreferencesWidget::ResultActions KeyboardShortcutsWidget::saveSettings()
Expand Down
9 changes: 1 addition & 8 deletions src/Dialogs/PreferenceWidgets/PluginWidget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
**
** Copyright (C) 2015-2021 Kevin B. Hendricks, Stratford Ontario Canada
** Copyright (C) 2015-2024 Kevin B. Hendricks, Stratford Ontario Canada
**
** This file is part of Sigil.
**
Expand Down Expand Up @@ -57,14 +57,7 @@ PluginWidget::PluginWidget()
m_qlcbxs.append(ui.comboBox_9);
m_qlcbxs.append(ui.comboBox_10);

ui.pluginTabWidget->setFocusPolicy(Qt::StrongFocus);
foreach(QComboBox* cb, m_qlcbxs) {
cb->setFocusPolicy(Qt::StrongFocus);
}
ui.pluginTable->setTabKeyNavigation(false);
ui.addButton->setFocusPolicy(Qt::StrongFocus);
ui.removeButton->setFocusPolicy(Qt::StrongFocus);
ui.removeAllButton->setFocusPolicy(Qt::StrongFocus);
readSettings();
connectSignalsToSlots();
}
Expand Down
13 changes: 0 additions & 13 deletions src/Dialogs/PreferenceWidgets/SpellCheckWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ SpellCheckWidget::SpellCheckWidget()
setUpTable();
readSettings();
connectSignalsToSlots();
ui.dictionaries->setFocusPolicy(Qt::StrongFocus);
ui.dictionaries2d->setFocusPolicy(Qt::StrongFocus);
ui.HighlightMisspelled->setFocusPolicy(Qt::StrongFocus);
ui.CheckNumbers->setFocusPolicy(Qt::StrongFocus);
ui.spellTabWidget->setFocusPolicy(Qt::StrongFocus);
ui.addUserDict->setFocusPolicy(Qt::StrongFocus);
ui.renameUserDict->setFocusPolicy(Qt::StrongFocus);
ui.copyUserDict->setFocusPolicy(Qt::StrongFocus);
ui.removeUserDict->setFocusPolicy(Qt::StrongFocus);
ui.addUserWords->setFocusPolicy(Qt::StrongFocus);
ui.editWord->setFocusPolicy(Qt::StrongFocus);
ui.removeWord->setFocusPolicy(Qt::StrongFocus);
ui.removeAll->setFocusPolicy(Qt::StrongFocus);
}

void SpellCheckWidget::setUpTable()
Expand Down
24 changes: 24 additions & 0 deletions src/Form_Files/EditTOC.ui
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<property name="text">
<string>Add Above</string>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -64,6 +67,9 @@
<property name="text">
<string>Add Below</string>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -74,6 +80,9 @@
<property name="text">
<string>Delete</string>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -84,6 +93,9 @@
<property name="text">
<string>Select Target</string>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -116,6 +128,9 @@ You can also use the left arrow key.</string>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -128,6 +143,9 @@ You can also use the left arrow key.</string>
<property name="arrowType">
<enum>Qt::UpArrow</enum>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -138,6 +156,9 @@ You can also use the left arrow key.</string>
<property name="arrowType">
<enum>Qt::DownArrow</enum>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
Expand All @@ -154,6 +175,9 @@ You can also use the right arrow key.</string>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
Expand Down
Loading

0 comments on commit 829b457

Please sign in to comment.