Bug 460689 - Bottom toolbar buttons have different fonts applied
Summary: Bottom toolbar buttons have different fonts applied
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.08.1
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-19 01:07 UTC by Jose Flores
Modified: 2022-12-07 11:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04


Attachments
Bug (149.95 KB, image/png)
2022-10-19 01:07 UTC, Jose Flores
Details
System Settings to display bug (164.74 KB, image/png)
2022-10-19 01:08 UTC, Jose Flores
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Flores 2022-10-19 01:07:40 UTC
Created attachment 153015 [details]
Bug

After changing the font system settings (Manjaro), it looks like the buttons on the main screen of Spectacle have different fonts/styles applied. 


STEPS TO REPRODUCE
1. Go to System Settings (Manjaro) -> Appearance -> Fonts
2. Change General font to a different size (different from Toolbar)
3. Open Spectacle
4. Notice the random styles of buttons

OBSERVED RESULT
Buttons on the bottom row are different sizes

EXPECTED RESULT
Same look for bottom row buttons

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.15-74-3-MANJARO
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
This is on Spectacle 22.08.1 and on the master branch (1ee8d43a5ce0b2122610e9184bfa43397d9f6be3 - Oct 16,2022).

These buttons are of these types:
* `QToolButton`: configure, annotate, copy, save
* `QPushButton`: tools, export
* `QDialogButtonBox`: Help

It looks like `QToolButton` follows the "Toolbar" font and (`QPushButton` and  `QDialogButtonBox`) follow the "General" font setting. 


I couldn't figure out how to make all of them use the same font (even though there is a `setFont` and `font()`) but I also looked at potentially making the `QToolButton`s into `QPushButton`s but `QPushButton`'s don't support having a menu and a default action like is needed for the "Save As" button or "Copy Image to Clipboard" button. I think it's possible to make everything a `QToolButton` but it would mean recreating the help menu used in the "Help" button (the others are more straight forward to covert).
Comment 1 Jose Flores 2022-10-19 01:08:14 UTC
Created attachment 153016 [details]
System Settings to display bug
Comment 2 Nate Graham 2022-10-19 18:10:57 UTC
So what's going on here is that under the hood, some of the buttons at the bottom are implemented as ToolButtons, and those inherit the Toolbar font size.

We should make them all regular raised pushbuttons.
Comment 3 Jose Flores 2022-10-20 02:15:42 UTC
Unfortunately I don't think regular push buttons have a way to have a menu and a default action (which the copy and save button use). It might still be possible but I couldn't figure out a way and it seemed like QPushButton didn't handle that case. Still possible if it's decided that the copy/save button don't need that functionality
Comment 4 Noah Davis 2022-12-07 11:46:53 UTC
Git commit 9d4ffdf70e5a29fa9105cbf8c4f7e1ddca9e377a by Noah Davis.
Committed on 07/12/2022 at 11:46.
Pushed by ndavis into branch 'master'.

Port and rework UI for Qt Quick/QML

There are still some parts that use Qt Widgets, such as the settings dialog, font dialog, color dialog, print dialog and popup menus. The Qt Quick port is needed for a future patch where screen recording will be added and it also allows more animations to be used. The UI was redesigned, partly because the old UI couldn't be ported nicely to QML and partly to improve the appearance of the UI.

There are 2 window classes for the main UIs. CaptureWindow is used for the rectangle capture mode and ViewerWindow is used for the other modes and viewing accepted regions from the rectangle capture mode. Both UIs support adding annotations.

Fullscreen Capture UI:

The UI is a lot like the old UI, but there are floating toolbars that expose more functionality.

- Annotations, saving, copying and taking a new snapshot can be done directly.
- Export, Options and Help menus can be accessed directly.
- Info box no longer covers or overlaps with selection handles.
- Antialiasing for selection handles is fixed.
- Each screen now has its own fullscreen window, which fixes some issues on Wayland and X11.

Image Viewer UI (appears after a screenshot has been taken):

- Main controls are consolidated into a single top toolbar: Save, Save As, Copy, Export (opens popup menu), Show Annotation Tools, Configure (opens settings dialog), Help (opens popup menu)
- There is a right sidebar for selecting capture modes and related options that were in the old UI.
- The whole UI doesn't completely transform when annotation controls are shown anymore. Instead, a vertical left side toolbar (tools) and a bottom toolbar (tool options) are added and the right sidebar slides away. Undo and Redo are added to the top toolbar.
- It should be easier to understand the annotation UI now.
- Annotations done in the Fullscreen Capture UI can still be undone/redone in the Image Viewer UI.

No screenshot taken UI (appears when configured to start without taking a screenshot):

- Has buttons for each capture mode on the left
- Has all the other options that were in the Image Viewer UI sidebar and the old UI on the right
- Has buttons for opening the settings dialog and showing the help menu below the options.
- The heading can be used to drag the window just to make moving the dialog around a bit more convenient.

The kImageAnnotator library was replaced by a custom annotation system because kImageAnnotator only worked with Qt Widgets and can't work in the rectangle capture mode since it has its own UI.

There is some unused code in this patch that is meant for the upcoming video recording feature.
Related: bug 407843, bug 425311, bug 425853, bug 427117, bug 429141, bug 431278, bug 437495, bug 451838, bug 456399, bug 458956, bug 462521
FIXED-IN: 23.04

---

| Fullscreen Capture UI |
|-----------------------|
| ![Screenshot_20221207_052432](/uploads/0a1a94987c80f831ef8ce65e29258797/Screenshot_20221207_052432.png) |

| Image Viewer UI |
|-----------------|
| ![Screenshot_20221207_052647](/uploads/05b9e19702c030228c21fb816af08ee4/Screenshot_20221207_052647.png) |

| No Screenshot UI |
|-----------------|
| ![Screenshot_20221207_053432](/uploads/9d97d6642d050ad84a14bf39f5a914db/Screenshot_20221207_053432.png) |

| Image Viewer Annotations |
|--------------------------|
| ![Screenshot_20221207_052825](/uploads/a8a7ffb4844fa0556eeeee4a979e85dd/Screenshot_20221207_052825.png) |

| Export Menu |
|-------------|
| ![Screenshot_20220823_141330](/uploads/3117057d424b66ae84f84648030912a8/Screenshot_20220823_141330.png) |

| Options Menu |
|--------------|
| ![Screenshot_20220823_141058](/uploads/05f0589b01ae61a90540d1dd6ba154ae/Screenshot_20220823_141058.png) |

| Help Menu |
|-----------|
| ![Screenshot_20220823_141353](/uploads/2f8173dd31cc0ef5c6c598ae6f5bb088/Screenshot_20220823_141353.png) |

| Annotation Options (sections are hidden based on what the active tool can use) |
|--------------------|
| ![Screenshot_20221207_053046](/uploads/ded7a02e8f68d659377abb5d9dc43b11/Screenshot_20221207_053046.png)![Screenshot_20221207_053136](/uploads/c11b21ce6762a7d287ae3e421762bb10/Screenshot_20221207_053136.png) |

M  +5    -18   CMakeLists.txt
A  +33   -0    resources.qrc
M  +20   -31   src/CMakeLists.txt
A  +139  -0    src/CaptureModeModel.cpp     [License: LGPL(v2.0+)]
A  +60   -0    src/CaptureModeModel.h     [License: LGPL(v2.0+)]
M  +10   -10   src/ExportManager.cpp
M  +6    -5    src/ExportManager.h
A  +38   -0    src/Gui/AnimatedLoader.qml     [License: LGPL(v2.0+)]
A  +287  -0    src/Gui/AnnotationOptionsToolBarContents.qml     [License: LGPL(v2.0+)]
A  +1406 -0    src/Gui/Annotations/AnnotationDocument.cpp     [License: LGPL(v2.0+)]
A  +288  -0    src/Gui/Annotations/AnnotationDocument.h     [License: LGPL(v2.0+)]
A  +43   -0    src/Gui/Annotations/AnnotationEditor.qml     [License: LGPL(v2.0+)]
A  +254  -0    src/Gui/Annotations/AnnotationViewport.cpp     [License: LGPL(v2.0+)]
A  +66   -0    src/Gui/Annotations/AnnotationViewport.h     [License: LGPL(v2.0+)]
A  +919  -0    src/Gui/Annotations/EditAction.cpp     [License: LGPL(v2.0+)]
A  +256  -0    src/Gui/Annotations/EditAction.h     [License: LGPL(v2.0+)]
A  +282  -0    src/Gui/Annotations/ResizeHandles.qml     [License: LGPL(v2.0+)]
A  +45   -0    src/Gui/Annotations/SelectionBackground.qml     [License: LGPL(v2.0+)]
A  +207  -0    src/Gui/Annotations/TextTool.qml     [License: LGPL(v2.0+)]
A  +86   -0    src/Gui/Annotations/Utils.cpp     [License: LGPL(v2.0+)]
A  +13   -0    src/Gui/Annotations/Utils.h     [License: LGPL(v2.0+)]
A  +152  -0    src/Gui/AnnotationsToolBarContents.qml     [License: LGPL(v2.0+)]
A  +101  -0    src/Gui/ButtonGrid.qml     [License: LGPL(v2.0+)]
D  +0    -176  src/Gui/CaptureAreaComboBox.cpp
D  +0    -55   src/Gui/CaptureAreaComboBox.h
A  +133  -0    src/Gui/CaptureOptionsSidebarContents.qml     [License: LGPL(v2.0+)]
A  +236  -0    src/Gui/CaptureWindow.cpp     [License: LGPL(v2.0+)]
A  +58   -0    src/Gui/CaptureWindow.h     [License: LGPL(v2.0+)]
A  +27   -0    src/Gui/CopiedMessage.qml     [License: LGPL(v2.0+)]
A  +138  -0    src/Gui/DelaySpinBox.qml     [License: LGPL(v2.0+)]
A  +232  -0    src/Gui/DialogPage.qml     [License: LGPL(v2.0+)]
A  +23   -0    src/Gui/EmptyPage.qml     [License: LGPL(v2.0+)]
M  +84   -16   src/Gui/ExportMenu.cpp
M  +7    -9    src/Gui/ExportMenu.h
A  +13   -0    src/Gui/FloatingBackground.qml     [License: LGPL(v2.0+)]
A  +40   -0    src/Gui/FloatingToolBar.qml     [License: LGPL(v2.0+)]
A  +72   -0    src/Gui/HelpMenu.cpp     [License: LGPL(v2.0+)]
A  +25   -0    src/Gui/HelpMenu.h     [License: LGPL(v2.0+)]
A  +420  -0    src/Gui/ImageCaptureOverlay.qml     [License: LGPL(v2.0+)]
A  +495  -0    src/Gui/ImageView.qml     [License: LGPL(v2.0+)]
A  +21   -0    src/Gui/InlineMessage.qml     [License: LGPL(v2.0+)]
D  +0    -86   src/Gui/KSImageWidget.cpp
D  +0    -44   src/Gui/KSImageWidget.h
D  +0    -714  src/Gui/KSMainWindow.cpp
D  +0    -116  src/Gui/KSMainWindow.h
D  +0    -363  src/Gui/KSWidget.cpp
D  +0    -105  src/Gui/KSWidget.h
A  +67   -0    src/Gui/Magnifier.qml     [License: LGPL(v2.0+)]
A  +158  -0    src/Gui/MainToolBarContents.qml     [License: LGPL(v2.0+)]
A  +269  -0    src/Gui/OptionsMenu.cpp     [License: LGPL(v2.0+)]
A  +62   -0    src/Gui/OptionsMenu.h     [License: LGPL(v2.0+)]
D  +0    -61   src/Gui/ProgressButton.cpp
D  +0    -29   src/Gui/ProgressButton.h
A  +10   -0    src/Gui/SavedAndCopiedMessage.qml     [License: LGPL(v2.0+)]
A  +10   -0    src/Gui/SavedAndLocationCopied.qml     [License: LGPL(v2.0+)]
A  +31   -0    src/Gui/SavedMessage.qml     [License: LGPL(v2.0+)]
A  +21   -0    src/Gui/ScreenshotFailedMessage.qml     [License: LGPL(v2.0+)]
A  +303  -0    src/Gui/Selection.cpp     [License: LGPL(v2.0+)]
A  +134  -0    src/Gui/Selection.h     [License: LGPL(v2.0+)]
A  +918  -0    src/Gui/SelectionEditor.cpp     [License: LGPL(v2.0+)]
A  +131  -0    src/Gui/SelectionEditor.h     [License: LGPL(v2.0+)]
M  +2    -2    src/Gui/SettingsDialog/GeneralOptions.ui
M  +5    -5    src/Gui/SettingsDialog/SaveOptionsPage.cpp
M  +9    -0    src/Gui/SettingsDialog/SettingsDialog.cpp
M  +1    -0    src/Gui/SettingsDialog/SettingsDialog.h
M  +3    -3    src/Gui/SettingsDialog/settings.kcfgc
M  +108  -22   src/Gui/SettingsDialog/spectacle.kcfg
A  +22   -0    src/Gui/ShareErrorMessage.qml     [License: LGPL(v2.0+)]
A  +29   -0    src/Gui/SharedMessage.qml     [License: LGPL(v2.0+)]
A  +99   -0    src/Gui/ShortcutsTextBox.qml     [License: LGPL(v2.0+)]
A  +29   -0    src/Gui/SizeLabel.qml     [License: LGPL(v2.0+)]
A  +70   -0    src/Gui/SpectacleImageProvider.cpp     [License: LGPL(v2.0+)]
A  +18   -0    src/Gui/SpectacleImageProvider.h     [License: LGPL(v2.0+)]
A  +42   -0    src/Gui/SpectacleMenu.cpp     [License: LGPL(v2.0+)]
A  +32   -0    src/Gui/SpectacleMenu.h     [License: LGPL(v2.0+)]
A  +499  -0    src/Gui/SpectacleWindow.cpp     [License: LGPL(v2.0+)]
A  +121  -0    src/Gui/SpectacleWindow.h     [License: LGPL(v2.0+)]
A  +57   -0    src/Gui/UndoRedoGroup.qml     [License: LGPL(v2.0+)]
A  +204  -0    src/Gui/ViewerWindow.cpp     [License: LGPL(v2.0+)]
A  +65   -0    src/Gui/ViewerWindow.h     [License: LGPL(v2.0+)]
M  +5    -5    src/Main.cpp
M  +14   -9    src/Platforms/Platform.h
M  +38   -13   src/Platforms/PlatformKWinWayland.cpp
M  +5    -0    src/Platforms/PlatformKWinWayland.h
M  +28   -7    src/Platforms/PlatformKWinWayland2.cpp
M  +4    -0    src/Platforms/PlatformKWinWayland2.h
M  +28   -13   src/Platforms/PlatformXcb.cpp
M  +4    -3    src/Platforms/PlatformXcb.h
D  +0    -29   src/QuickEditor/ComparableQPoint.h
D  +0    -1042 src/QuickEditor/QuickEditor.cpp
D  +0    -140  src/QuickEditor/QuickEditor.h
A  +15   -0    src/ScreenImage.h     [License: LGPL(v2.0+)]
D  +0    -20   src/SpectacleCommon.h
M  +541  -303  src/SpectacleCore.cpp
M  +93   -41   src/SpectacleCore.h
M  +5    -6    src/SpectacleDBusAdapter.cpp
M  +3    -1    tests/CMakeLists.txt
M  +5    -5    tests/FilenameTest.cpp

https://invent.kde.org/graphics/spectacle/commit/9d4ffdf70e5a29fa9105cbf8c4f7e1ddca9e377a