Commit graph

28 commits

Author SHA1 Message Date
Olivier Goffart
6699067351 TabWidget: focus the tab when clicking on it
The Tab currently doesn't do anything with the focus, but this
serves as a workaround for #798 so that inner widget of a tab can't
keep the focus when they are hidden

cc #798
2022-01-12 14:54:04 +01:00
Olivier Goffart
f5cf60ea23 NativeComboBox: don't show the combobox as open
Because we currently don't have a way to detect when the popup is closed
we workaround the problem by never show the combo box as open.

Workaround #456
2022-01-03 12:52:20 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Olivier Goffart
310bf897cd Native ComboBox: style the background of the popup
Fixes: #720
2021-12-06 18:52:10 +01:00
Olivier Goffart
2ffa83db0e Native Style: hover effect on NativeStandardListViewItem 2021-12-06 18:52:10 +01:00
Olivier Goffart
e4bd6bbfb8 Native style: respond to the StyleChange event
So that color scheme is updated when switching to the dark style, for example

Fixes #687
2021-11-29 17:18:23 +01:00
Olivier Goffart
cd14e1d70c Move the NativeButtonVTable in the right module 2021-11-18 10:23:06 +01:00
Olivier Goffart
40a6f3e740 Polish the Native Spinbox: There is a line edit that need to be drawn inside 2021-11-17 08:44:08 +01:00
Simon Hausmann
13de800ba3 Internal cleanup: Rename layouting_info to layout_info
That's making the call on the Component VTable consistent(ish) with the Item VTable.
2021-11-08 10:24:30 +01:00
Simon Hausmann
dec6c6ca51 Work around crash in Qt mac style when drawing scrollbars with invalid size
Fixes #595
2021-10-19 12:36:26 +02:00
Olivier Goffart
4436b422e5 Fix LineEdit.has-focus witht he native style
The property had the wrong name.

Also it is not a native-output
2021-10-14 15:34:25 +02:00
Simon Hausmann
7102f9b997 Fix standard button OK text
Ok -> OK
2021-10-06 16:16:39 +02:00
Simon Hausmann
6dce5ab32e Fix rendering of push buttons with QStyle on macOS
The button bevel was rendered upside down, which happens due to some
weird double y-axis inversion, which goes away when passing the QWidget
pointer to the style. When using the Qt backend, we can do that.
2021-10-06 14:39:56 +02:00
Olivier Goffart
a1b27c47ae Small cleanup
The is_standard_button is alays true because the None path returns a few line before
2021-10-06 10:53:30 +02:00
Simon Hausmann
d43e0a1c83 Qt style: Only show icons in standard buttons if the style permits 2021-10-06 10:45:31 +02:00
Olivier Goffart
2716e4b4dd TouchArea: add the pointer-event callback
... instead of `pressed-changed`

This allows to see what mouse button was pressed.

Closes #535
2021-10-04 14:39:49 +02:00
Olivier Goffart
dc10916129 Attempt to improve a bit the look of the native scrollbar
This tries to adjust the position of the scrollbar depending of the value of
SH_ScrollView_FrameOnlyAroundContents
2021-10-01 12:58:00 +02:00
Olivier Goffart
e858b3e8d5 Fix TabWidget drawing with the Qt Fusion style
- The Tab must be drawn before the contents, because the style draws something under the active tab,
   outside of its region
 - Also set the QStyleOptionTab::HasFrame flag since we are in the equivalent of a QTabWidget
2021-09-30 19:43:53 +02:00
Olivier Goffart
5935b99c73 Fix indentation 2021-09-30 19:11:40 +02:00
Olivier Goffart
c7227f35cc Native style: Fix size of button with icon
Some styles recompute the size based on the contents given in the QStyleOptionButton,
Some styles need to be given the icon in their content size. And this was not done properly
2021-09-30 19:10:00 +02:00
Olivier Goffart
671df0f24f New widget: StandardButton 2021-09-29 16:25:44 +02:00
Simon Hausmann
c86f2617b3 Fix natively styled list view item active/inactive rendering
Amends commit ed3d848d02
2021-09-15 15:39:15 +02:00
Simon Hausmann
ed3d848d02 Fix native widget rendering when the window is inactive
Set QStyle::State_Active conditional to whether the window is active,
which maps to Qt's active window concept and winit's has-focus (until we
render popups differently).
2021-09-15 15:34:34 +02:00
Simon Hausmann
1b64db70bd Fix rendering of the current tab in the natively styled tab widget on macOS
It was impossible to see which tab was the current tab.
Ensure that we set State_Active, like we do for the other styled controls.

Later, the active state should be tied to whether the window is "active" or not.
2021-09-15 13:35:41 +02:00
Simon Hausmann
85a46c07b7 Fix panic when using height-for-width element in natively styled TabWidget
The metrics properties and the implementation of layout_info needs to
strictly reading cross-axis properties to avoid circular dependencies.

This patch applies a INT_MAX / 2 on the cross-axis to QStyle when
querying. Mostly the styles appear to just add/subtract margins, so this
value should not produce overflows while still providing an
approximation of "infinite" :)

Fixes #412
2021-09-14 10:05:15 +02:00
Olivier Goffart
cbf22d494e TextEdit 2021-09-06 21:52:12 +02:00
Olivier Goffart
ed24492db7 Only emit click when clicking and releasing the mouse within the TouchArea
Closes #455
2021-09-04 12:36:13 +02:00
Olivier Goffart
50ca8a924c Split qt_widgets.rs in several modules
It was the bigger rust file in the repository
2021-09-02 12:18:21 +02:00