From cc5ba638d1f6f2b997b2973c291639462ca25983 Mon Sep 17 00:00:00 2001 From: forbes Date: Sun, 8 Feb 2026 13:27:22 -0600 Subject: [PATCH 1/2] =?UTF-8?q?fix(gui):=20UI=20appearance=20polish=20?= =?UTF-8?q?=E2=80=94=20Wayland=20scaling,=20menu=20icon=20size=20pref,=20d?= =?UTF-8?q?ialog=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix hazy text on Wayland by setting QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor and QT_ENABLE_HIGHDPI_SCALING=1 in deb and AppImage launchers; remove forced QT_QPA_PLATFORM=xcb from AppImage to allow native Wayland (fixes #33) - Add menu icon size preference selector (Small/Medium/Large/Extra large) in General preferences, applied via QMenu stylesheet at startup and on save (fixes #46) - Replace verbose theme customization banner with concise 'Kindred Create Theme' label in UI preferences; split Overlay group into 'Panel Visibility' and 'Overlay Interaction' sections (fixes #35) - Remove Addon Manager branding label from General preferences, change recent file list default from 4 to 10 (fixes #36) --- package/debian/build-deb.sh | 4 + package/rattler-build/linux/AppDir/AppRun | 5 +- .../PreferencePages/DlgSettingsGeneral.cpp | 93 ++++++++++++++----- src/Gui/PreferencePages/DlgSettingsGeneral.h | 5 +- src/Gui/PreferencePages/DlgSettingsGeneral.ui | 36 +++---- src/Gui/PreferencePages/DlgSettingsUI.ui | 61 ++++++------ src/Gui/StartupProcess.cpp | 11 +++ src/Gui/StartupProcess.h | 1 + 8 files changed, 144 insertions(+), 72 deletions(-) diff --git a/package/debian/build-deb.sh b/package/debian/build-deb.sh index b501622601..7726fc4200 100755 --- a/package/debian/build-deb.sh +++ b/package/debian/build-deb.sh @@ -112,6 +112,10 @@ export XKB_CONFIG_ROOT="${KINDRED_CREATE_HOME}/share/X11/xkb" export FONTCONFIG_FILE="${KINDRED_CREATE_HOME}/etc/fonts/fonts.conf" export FONTCONFIG_PATH="${KINDRED_CREATE_HOME}/etc/fonts" +# Qt Wayland fractional scaling — force integer rounding to avoid blurry text +export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor +export QT_ENABLE_HIGHDPI_SCALING=1 + # Use system CA certificates so bundled Python trusts internal CAs (e.g. FreeIPA) # The bundled openssl has a hardcoded cafile from the build environment which # does not exist on the target system. diff --git a/package/rattler-build/linux/AppDir/AppRun b/package/rattler-build/linux/AppDir/AppRun index f118738801..91775c4aac 100755 --- a/package/rattler-build/linux/AppDir/AppRun +++ b/package/rattler-build/linux/AppDir/AppRun @@ -9,8 +9,9 @@ export PATH_TO_FREECAD_LIBDIR=${HERE}/usr/lib export FONTCONFIG_FILE=/etc/fonts/fonts.conf export FONTCONFIG_PATH=/etc/fonts -# Fix: Use X to run on Wayland -export QT_QPA_PLATFORM=xcb +# Qt HiDPI scaling — force integer rounding to avoid blurry text on fractional scales +export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor +export QT_ENABLE_HIGHDPI_SCALING=1 # Show packages info if DEBUG env variable is set if [ "$DEBUG" = 1 ]; then diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp index 3cdc709534..b045da1e8c 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -96,7 +97,6 @@ DlgSettingsGeneral::DlgSettingsGeneral(QWidget* parent) ui->SaveNewPreferencePack->setEnabled(false); ui->ManagePreferencePacks->setEnabled(false); ui->themesCombobox->setEnabled(false); - ui->moreThemesLabel->setEnabled(false); } } } @@ -121,7 +121,6 @@ DlgSettingsGeneral::DlgSettingsGeneral(QWidget* parent) this, &DlgSettingsGeneral::onThemeChanged ); - connect(ui->moreThemesLabel, &QLabel::linkActivated, this, &DlgSettingsGeneral::onLinkActivated); } // If there are any saved config file backs, show the revert button, otherwise hide it: @@ -147,9 +146,6 @@ DlgSettingsGeneral::DlgSettingsGeneral(QWidget* parent) const auto visible = UnitsApi::isMultiUnitLength(); ui->comboBox_FracInch->setVisible(visible); ui->fractionalInchLabel->setVisible(visible); - ui->moreThemesLabel->setEnabled( - Application::Instance->commandManager().getCommandByName("Std_AddonMgr") != nullptr - ); } /** @@ -166,7 +162,7 @@ void DlgSettingsGeneral::setRecentFileSize() auto recent = getMainWindow()->findChild(QLatin1String("recentFiles")); if (recent) { ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("RecentFiles"); - recent->resizeList(hGrp->GetInt("RecentFiles", 4)); + recent->resizeList(hGrp->GetInt("RecentFiles", 10)); } } @@ -264,6 +260,11 @@ void DlgSettingsGeneral::saveSettings() hGrp->SetInt("ToolbarIconSize", pixel); getMainWindow()->setIconSize(QSize(pixel, pixel)); + QVariant menuSize = ui->menuIconSize->itemData(ui->menuIconSize->currentIndex()); + int menuPixel = menuSize.toInt(); + hGrp->SetInt("MenuIconSize", menuPixel); + applyMenuIconSize(menuPixel); + int blinkTime {hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0}; qApp->setCursorFlashTime(blinkTime); @@ -348,6 +349,7 @@ void DlgSettingsGeneral::loadSettings() } addIconSizes(getCurrentIconSize()); + addMenuIconSizes(getCurrentMenuIconSize()); // TreeMode combobox setup. loadDockWindowVisibility(); @@ -395,8 +397,9 @@ void DlgSettingsGeneral::resetSettingsToDefaults() hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); // reset "Language" parameter hGrp->RemoveASCII("Language"); - // reset "ToolbarIconSize" parameter + // reset "ToolbarIconSize" and "MenuIconSize" parameters hGrp->RemoveInt("ToolbarIconSize"); + hGrp->RemoveInt("MenuIconSize"); // finally reset all the parameters associated to Gui::Pref* widgets PreferencePage::resetSettingsToDefaults(); @@ -534,6 +537,63 @@ void DlgSettingsGeneral::translateIconSizes() } } +int DlgSettingsGeneral::getCurrentMenuIconSize() const +{ + ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); + return hGrp->GetInt("MenuIconSize", 24); +} + +void DlgSettingsGeneral::addMenuIconSizes(int current) +{ + ui->menuIconSize->clear(); + + QList sizes {16, 20, 24, 28}; + if (!sizes.contains(current)) { + sizes.append(current); + } + + for (int size : sizes) { + ui->menuIconSize->addItem(QString(), QVariant(size)); + } + + int index = ui->menuIconSize->findData(QVariant(current)); + ui->menuIconSize->setCurrentIndex(index); + translateMenuIconSizes(); +} + +void DlgSettingsGeneral::translateMenuIconSizes() +{ + auto getSize = [this](int index) { + return ui->menuIconSize->itemData(index).toInt(); + }; + + QStringList sizes; + sizes << tr("Small (%1px)").arg(getSize(0)); + sizes << tr("Medium (%1px)").arg(getSize(1)); + sizes << tr("Large (%1px)").arg(getSize(2)); + sizes << tr("Extra large (%1px)").arg(getSize(3)); + if (ui->menuIconSize->count() > 4) { + sizes << tr("Custom (%1px)").arg(getSize(4)); + } + + for (int index = 0; index < sizes.size(); index++) { + ui->menuIconSize->setItemText(index, sizes[index]); + } +} + +void DlgSettingsGeneral::applyMenuIconSize(int pixel) +{ + // Apply menu icon size via stylesheet override on all QMenu widgets + QString rule = QStringLiteral("QMenu::icon { width: %1px; height: %1px; }").arg(pixel); + for (auto* widget : qApp->allWidgets()) { + if (auto* menu = qobject_cast(widget)) { + menu->setStyleSheet(rule); + } + } + // Store the rule so new menus pick it up via the main window + getMainWindow()->setProperty("_menuIconSizeRule", rule); +} + void DlgSettingsGeneral::retranslateUnits() { auto setItem = [&, index {0}](const std::string& item) mutable { @@ -547,6 +607,7 @@ void DlgSettingsGeneral::changeEvent(QEvent* event) { if (event->type() == QEvent::LanguageChange) { translateIconSizes(); + translateMenuIconSizes(); retranslateUnits(); int index = ui->UseLocaleFormatting->currentIndex(); ui->retranslateUi(this); @@ -823,24 +884,6 @@ void DlgSettingsGeneral::onThemeChanged(int index) themeChanged = true; } -void DlgSettingsGeneral::onLinkActivated(const QString& link) -{ - auto const addonManagerLink = QStringLiteral("freecad:Std_AddonMgr"); - - if (link != addonManagerLink) { - return; - } - - // Set the user preferences to include only preference packs. - // This is a quick and dirty way to open Addon Manager with only themes. - auto pref = App::GetApplication().GetParameterGroupByPath( - "User parameter:BaseApp/Preferences/Addons" - ); - pref->SetInt("PackageTypeSelection", 3); // 3 stands for Preference Packs - pref->SetInt("StatusSelection", 0); // 0 stands for any installation status - - Gui::Application::Instance->commandManager().runCommandByName("Std_AddonMgr"); -} /////////////////////////////////////////////////////////// namespace diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.h b/src/Gui/PreferencePages/DlgSettingsGeneral.h index 33c49819b5..f977a50a26 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.h +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.h @@ -72,7 +72,6 @@ protected Q_SLOTS: void onManagePreferencePacksClicked(); void onImportConfigClicked(); void onThemeChanged(int index); - void onLinkActivated(const QString& link); public Q_SLOTS: void onUnitSystemIndexChanged(int index); @@ -91,6 +90,10 @@ private: int getCurrentIconSize() const; void addIconSizes(int current); void translateIconSizes(); + int getCurrentMenuIconSize() const; + void addMenuIconSizes(int current); + void translateMenuIconSizes(); + static void applyMenuIconSize(int pixel); private: int localeIndex; diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.ui b/src/Gui/PreferencePages/DlgSettingsGeneral.ui index 798e29fa78..553978c9e2 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.ui +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.ui @@ -219,35 +219,35 @@ dot/period will always be printed - - - - - 8 - - - - Looking for more themes? You can obtain them using the <a href="freecad:Std_AddonMgr">Addon Manager</a>. - - - Qt::RichText - - - - + + Size of toolbar icons - + Icon size in the toolbar + + + + Size of menu icons + + + + + + + Icon size in context menus and dropdown menus + + + @@ -278,7 +278,7 @@ dot/period will always be printed How many files should be listed in recent files list - 4 + 10 RecentFiles diff --git a/src/Gui/PreferencePages/DlgSettingsUI.ui b/src/Gui/PreferencePages/DlgSettingsUI.ui index ba6eaf104a..0a3177c0ce 100644 --- a/src/Gui/PreferencePages/DlgSettingsUI.ui +++ b/src/Gui/PreferencePages/DlgSettingsUI.ui @@ -23,7 +23,7 @@ - Customize the current theme. The offered settings are optional for theme developers so they may or may not have an effect in the current theme. + Kindred Create Theme true @@ -392,10 +392,10 @@ - Overlay + Panel Visibility - + Hide tab bar in dock overlay @@ -414,23 +414,7 @@ - - - - Show tab bar on mouse over when auto hide - - - Hint show tab bar - - - DockOverlayHintTabBar - - - View - - - - + Hide property view scroll bar in dock overlay @@ -446,7 +430,7 @@ - + Automatically hide overlaid dock panels when in non 3D view (e.g. TechDraw or Spreadsheet) @@ -465,13 +449,22 @@ - + + + + + + + Overlay Interaction + + + - Auto mouse click through transparent part of dock overlay. + Auto mouse click through transparent part of dock overlay - Automatically pass through of the mouse cursor + Automatically pass through mouse cursor true @@ -484,13 +477,13 @@ - + Automatically passes mouse wheel events through the transparent areas of an overlay panel - Automatically pass through of the mouse wheel + Automatically pass through mouse wheel true @@ -503,6 +496,22 @@ + + + + Show tab bar on mouse over when auto hide + + + Hint show tab bar + + + DockOverlayHintTabBar + + + View + + + diff --git a/src/Gui/StartupProcess.cpp b/src/Gui/StartupProcess.cpp index fd1f497535..f487a6634c 100644 --- a/src/Gui/StartupProcess.cpp +++ b/src/Gui/StartupProcess.cpp @@ -56,6 +56,7 @@ #include "Language/Translator.h" #include "Dialogs/DlgVersionMigrator.h" #include "FreeCADStyle.h" +#include "PreferencePages/DlgSettingsGeneral.h" #include #include @@ -226,6 +227,7 @@ void StartupPostProcess::execute() setProcessMessages(); setAutoSaving(); setToolBarIconSize(); + setMenuIconSize(); setWheelEventFilter(); setLocale(); setCursorFlashing(); @@ -281,6 +283,15 @@ void StartupPostProcess::setToolBarIconSize() } } +void StartupPostProcess::setMenuIconSize() +{ + ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); + int size = int(hGrp->GetInt("MenuIconSize", 0)); + if (size >= 16) { + DlgSettingsGeneral::applyMenuIconSize(size); + } +} + void StartupPostProcess::setWheelEventFilter() { // filter wheel events for combo boxes diff --git a/src/Gui/StartupProcess.h b/src/Gui/StartupProcess.h index cf4a84daff..5a12b65b58 100644 --- a/src/Gui/StartupProcess.h +++ b/src/Gui/StartupProcess.h @@ -64,6 +64,7 @@ private: void setProcessMessages(); void setAutoSaving(); void setToolBarIconSize(); + void setMenuIconSize(); void setWheelEventFilter(); void setLocale(); void setCursorFlashing(); From 262dfa583dcff3a349f1ea15849eee292e6744cc Mon Sep 17 00:00:00 2001 From: forbes Date: Sun, 8 Feb 2026 13:36:57 -0600 Subject: [PATCH 2/2] fix(defaults): tune Document, Selection, and Notification preference defaults Document (fixes #37): - Increase max undo/redo steps from 20 to 50 - Reduce auto-save interval from 15 to 5 minutes - Increase max backup files from 1 to 3 - Set license to Other with blank URL (removes Wikipedia link) Selection (fixes #38): - Enable preselect-on-tree-hover (PreSelection) - Enable auto-switch to 3D view (SyncView) - Enable auto-expand tree item (SyncSelection) Notification Area (fixes #40): - Reduce max notification list from 1000 to 100 - Reduce max concurrent popups from 15 to 3 - Reduce bubble width from 800px to 400px - Reduce max popup duration from 20s to 10s - Reduce min popup duration from 5s to 3s --- .../preferences/KindredCreate/KindredCreate.cfg | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/resources/preferences/KindredCreate/KindredCreate.cfg b/resources/preferences/KindredCreate/KindredCreate.cfg index 4601efe882..fe8b92cc31 100644 --- a/resources/preferences/KindredCreate/KindredCreate.cfg +++ b/resources/preferences/KindredCreate/KindredCreate.cfg @@ -72,9 +72,26 @@ + + + + + + + + + + + + + + + + + ZToolsWorkbench