mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
Comments
Took 23 minutes Took 15 seconds
This commit is contained in:
parent
0195be8922
commit
ccd2e15629
2 changed files with 39 additions and 10 deletions
|
|
@ -50,7 +50,7 @@
|
||||||
* @param widget The widget to wrap
|
* @param widget The widget to wrap
|
||||||
* @return The scroll area containing the widget
|
* @return The scroll area containing the widget
|
||||||
*/
|
*/
|
||||||
static QScrollArea *makeScrollableModern(QWidget *widget)
|
static QScrollArea *makeScrollable(QWidget *widget)
|
||||||
{
|
{
|
||||||
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum);
|
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum);
|
||||||
|
|
||||||
|
|
@ -75,6 +75,8 @@ DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent), currentTabIndex(0),
|
||||||
connect(&SettingsCache::instance().personal(), &PersonalSettings::langChanged, this, &DlgSettings::retranslateUi);
|
connect(&SettingsCache::instance().personal(), &PersonalSettings::langChanged, this, &DlgSettings::retranslateUi);
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
|
||||||
|
searchEdit->setFocus();
|
||||||
|
|
||||||
adjustSize();
|
adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,14 +116,14 @@ void DlgSettings::setupUi()
|
||||||
pages.append(soundPage);
|
pages.append(soundPage);
|
||||||
pages.append(shortcutsPage);
|
pages.append(shortcutsPage);
|
||||||
|
|
||||||
pagesWidget->addWidget(makeScrollableModern(generalPage));
|
pagesWidget->addWidget(makeScrollable(generalPage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(appearancePage));
|
pagesWidget->addWidget(makeScrollable(appearancePage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(userInterfacePage));
|
pagesWidget->addWidget(makeScrollable(userInterfacePage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(deckEditorPage));
|
pagesWidget->addWidget(makeScrollable(deckEditorPage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(storagePage));
|
pagesWidget->addWidget(makeScrollable(storagePage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(messagesPage));
|
pagesWidget->addWidget(makeScrollable(messagesPage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(soundPage));
|
pagesWidget->addWidget(makeScrollable(soundPage));
|
||||||
pagesWidget->addWidget(makeScrollableModern(shortcutsPage));
|
pagesWidget->addWidget(makeScrollable(shortcutsPage));
|
||||||
|
|
||||||
// Search results view (hidden by default)
|
// Search results view (hidden by default)
|
||||||
searchResultsView = new QListView;
|
searchResultsView = new QListView;
|
||||||
|
|
@ -388,7 +390,6 @@ void DlgSettings::navigateToSearchResult(const QModelIndex &index)
|
||||||
if (scrollArea) {
|
if (scrollArea) {
|
||||||
scrollArea->ensureWidgetVisible(entry.widget);
|
scrollArea->ensureWidgetVisible(entry.widget);
|
||||||
}
|
}
|
||||||
entry.widget->setFocus();
|
|
||||||
flashWidget(entry.widget);
|
flashWidget(entry.widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,20 @@ QList<SettingsSearchEntry> AbstractSettingsPage::autoDetectSearchEntries(QWidget
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!label.isEmpty()) {
|
if (!label.isEmpty()) {
|
||||||
|
// Skip QLabels that are not setting names: HTML, path values, or excessively long
|
||||||
|
if (qobject_cast<QLabel *>(widget)) {
|
||||||
|
auto *labelWidget = static_cast<QLabel *>(widget);
|
||||||
|
if (labelWidget->textFormat() != Qt::PlainText) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (label.contains(QLatin1Char('/')) || label.contains(QLatin1Char('\\'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (label.size() > 60) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Strip accelerator markers (&) for search
|
// Strip accelerator markers (&) for search
|
||||||
QString cleanLabel = label;
|
QString cleanLabel = label;
|
||||||
cleanLabel.remove(QLatin1Char('&'));
|
cleanLabel.remove(QLatin1Char('&'));
|
||||||
|
|
@ -96,6 +110,20 @@ QList<SettingsSearchEntry> AbstractSettingsPage::autoDetectSearchEntries(QWidget
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!label.isEmpty()) {
|
if (!label.isEmpty()) {
|
||||||
|
// Skip QLabels that are not setting names: HTML, path values, or excessively long
|
||||||
|
if (qobject_cast<QLabel *>(nestedWidget)) {
|
||||||
|
auto *labelWidget = static_cast<QLabel *>(nestedWidget);
|
||||||
|
if (labelWidget->textFormat() != Qt::PlainText) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (label.contains(QLatin1Char('/')) || label.contains(QLatin1Char('\\'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (label.size() > 60) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString cleanLabel = label;
|
QString cleanLabel = label;
|
||||||
cleanLabel.remove(QLatin1Char('&'));
|
cleanLabel.remove(QLatin1Char('&'));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue