Repository navigation
feat: SG-45798: Add a value box to the text font size dropdown - #1475
Open
cedrik-fuoco-adsk wants to merge 4 commits into
Open
cedrik-fuoco-adsk wants to merge 4 commits into
cedrik-fuoco-adsk wants to merge 4 commits into
Conversation
The text font size dropdown only offered S, M and L. It now follows the Figma design: the open menu lists Small, Medium and Large, and a value box below them shows the current size and accepts any size from 1 to 100. Picking a preset fills the box with 24, 48 or 72. The font size setting is now an integer instead of a preset name, and the engine sizes new text as size / 1080 * screen scale, so the presets render as before. A size saved by an earlier version as "small", "medium" or "large" is not converted. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
cedrik-fuoco-adsk
force-pushed
the
SG-45798-font-size-dropdown-value-box
branch
from
October 30, 2026 18:26
7deb422 to
e516a59
Compare
cedrik-fuoco-adsk
marked this pull request as ready for review
November 2, 2026 13:23
cedrik-fuoco-adsk
requested review from
bernie-laberge and
eloisebrosseau
as code owners
November 2, 2026 13:23
|
|
||
| self._size_input = _MenuValueLineEdit() | ||
| self._size_input.setObjectName("sliderValue") | ||
| self._size_input.setToolTip("Size") |
Contributor
There was a problem hiding this comment.
I believe there is no tooltip for the font size drop-down.
| self._size_input = _MenuValueLineEdit() | ||
| self._size_input.setObjectName("sliderValue") | ||
| self._size_input.setToolTip("Size") | ||
| self._size_input.setAlignment(QtCore.Qt.AlignCenter) |
Contributor
There was a problem hiding this comment.
This should be left-aligned to match the Figma design.
Contributor
Author
There was a problem hiding this comment.
Good catch, I missed the left align
|
|
||
| def set_font_size(self, size): | ||
| self._size_button.set_selection(size if self._size_button.has_item(size) else constants.FontSize.MEDIUM) | ||
| self._font_size_button.set_font_size(size) |
Contributor
There was a problem hiding this comment.
With this change, _MenuToolButton.has_item() is now unused.
Comment on lines
+781
to
+787
| super().__init__(parent) | ||
| self.setObjectName("menuToolButton") | ||
| self.setProperty("tbstyle", "palette") | ||
| self.setToolTip("Size") | ||
| self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) | ||
| self.setFixedHeight(30) | ||
| self.setPopupMode(QtWidgets.QToolButton.InstantPopup) |
Contributor
There was a problem hiding this comment.
Lines 782 to 787 are an exact copy of PopupToolButton. You should subclass it inside of duplicating it.
Fall back to the default font size when a saved value is not a number, which is how a size saved by an earlier version as "small", "medium" or "large" reads back (as 0). Make _FontSizeButton subclass _PopupToolButton instead of repeating its setup, left-align the value box, remove the "Size" tooltips, and delete the now unused _MenuToolButton.has_item(). Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Closing the font size menu by clicking away now applies the typed size instead of relying on the order Qt emits editingFinished and aboutToHide. Escape still cancels the edit by reverting the value box before the menu closes. Text that is not a number reverts to the current size. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Contributor
Author
|
Comments have been addressed @eloisebrosseau @bernie-laberge |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issues
None
Summarize your change.
The text font size dropdown in the new annotation tools now has a value box under the presets. Users can type any size from 1 to 100, and picking a preset shows its number in the box.
Describe the reason for the change.
The dropdown only offered S, M and L, so there was no way to choose another size or to see which number a preset stood for. The design adds a value box and shows the full preset names while the menu is open.
A size saved by an earlier version as
"small","medium"or"large"is not converted.readSettingsreads it back as 0, so it falls back to the default size (48) instead of the size the user had picked.Describe what you have tested and on which operating system.
Tested on macOS with a debug build:
Add a list of changes, and note any that might need special attention during the review.
S,MorL(or the number when the size matches no preset), and the open menu listsSmall,MediumandLargewith a check on the current one.font_sizeis now stored as an integer (24, 48 and 72 for the presets) instead of"small","medium"or"large", andfont_size_changedcarries anint.If possible, provide screenshots.
2026-10-30.10-43-56.mov