Commit Graph

152 Commits (027f56d83054749c45a3de144cc81f2dbce88175)

Author SHA1 Message Date
Alex Huszagh 027f56d830 Move applicable standard icons to template.
Move the standard icons that can be used in a stylesheet from a plugin
to the main template directory. This allows us to overwrite more icons,
increasing visual consistency between platforms.
2022-05-03 02:41:07 -05:00
Alex Huszagh a999f985a1 Update calendar next and previous icons. 2022-05-03 02:04:02 -05:00
Alex Huszagh 71eaba28c7 Update documentation for QCommandLinkButton.
Document the inability to theme the QCommandLinkButton default icon.
Although the icon can be hard-coded via `qproperty-icon` and the size
via `qproperty-iconSize`, it can no longer be customized, defeating the
purpose.

Closes #60.
2022-05-03 01:42:58 -05:00
Alex Huszagh ceb1d7c3f4 Fix next/back icons in QCalendarWidget on Windows.
Used `qproperty-iconSize` to force the icon sizes to 0, and then used the `image` property to ensure the correct icons are set. There is no good way to ensure both are the same size on Qt5 and Qt6, but they are close enough. Any approach of forcing them to be the same size results in massive pixelation in Qt6.

Closes #57.
2022-05-03 00:21:24 -05:00
Alex Huszagh e655104334 Fix missing comma after selector. 2022-05-02 22:17:20 -05:00
Alex Huszagh a91550bad1 Added more widgets to sample UI. 2022-05-02 22:15:56 -05:00
Alex Huszagh e67fc2044a Fix the arrow indicators on QTabBar scrolling.
Remove the `QTabBar QToolButton::*-arrow` rules, since they use
`border-image` which conflicts with the `image` on
`QToolButton::*-arrow` rules, causing 2 arrows to be drawn. The
`border-image` also tends to be incorrectly stretched, so we use `image`
instead. Also changed `QToolButton` background from `transparent` to
`^background^`, so the arrow indicators rise above the QTabBar.

Fixes #56.
2022-05-02 21:40:10 -05:00
Alex Huszagh 267d6544cd Further fixes to QToolButton padding.
Added `hasMenu` property so the user can manually override the padding on QToolButtons.

Updated the `QToolBar` to remove `min-height` and `min-width` so the icons can pack closer to together, and specified custom padding rules for the regular icons and those with the drop-down menus. These are narrowly selected via `QDialog QToolBar QToolButton`, and can be manually overridden via `hasMenu`, so they're unlikely to affect anything other than `QFileDialog`.

Likewise, updated the rules for `QToolButton` padding to ensure the button is padded only if it is not auto-raised and it has text. Likewise, this can be manually overridden via the `hasMenu` property. These rules are extensively described in the stylesheet comments.

Further improves the patches to #22, #28, and #47.
2022-05-02 21:30:46 -05:00
Alex Huszagh acc1beba4a Fix padding on QToolButtons.
Fix the padding on non-auto-raised QToolButtons, since the icon-only QToolButtons had the padding of the text ones. Unfortunately, `ToolButtonStyle` is set by the user, and is only adjusted in `QStyleOptionToolButton::toolButtonStyle`, and not in `QToolButton`. This means we have no way of removing the extra padding on text-only items, but it's a small price to pay.

Fixes #47.
2022-05-02 19:09:17 -05:00
Alex Huszagh babdabb092 Fix QTreeView indicators in Qt6.
Fix the QTreeView indicators (checkboxes) that were using the style
defaults except if they had a hover/focus/selected psuedostate. This
only affected Qt6. Setting `QTreeView::item`'s `background-color`
weirdly fixes this stylesheet bug.

Closes #51.
2022-05-02 17:50:39 -05:00
Alex Huszagh f5a6a9fb77 Fix highlighting of QGroupBox checkbox.
Fix the highlighting of an unchecked QGroupBox when it is not hovered or the active widget.

Closes #55.
2022-05-02 17:26:31 -05:00
Alex Huszagh e96a0049f0 Document QCompleter bug with Qt5.
Closes #52.
2022-05-02 17:08:04 -05:00
Alex Huszagh 35eae0c67c Made arrow size in QColumnView consistent.
Used the `QAbstractItemView::item` subcontrol `max-height` and
`QAbstractItemView::*-arrow` subcontrol `margin` to ensure size
consistency between Qt5 and Qt6, otherwise, Qt6 has a much larger arrow
size which creates visual inconsistency.
2022-05-02 16:21:37 -05:00
Alex Huszagh 2a90ca995a Fix scrollbar + sizegrip issue causing view expansion.
Removed the style for `QWidget:disabled:hover`, which causes the issue, and seemingly has no negative consequences since the default background color is still `^background^` without it.

Closes #54.
2022-05-02 15:40:05 -05:00
Alex Huszagh 8ad730cd70 Fix QColumnView with stylesheet.
Removes the border on QColumnView when not focused, and uses the correct
arrows through the QAbstractItemView::left-arrow and
QAbastractItemView::right-arrow subcontrols to style the arrows.

Closes #45.
Closes #46.
2022-05-02 14:25:28 -05:00
Alex Huszagh ae42e0d6f9 Revert QAbstractSlider to QSlider.
Only 3 widgets subclass QAbstractSlider: QSlider, QScrollBar, and QDial.
We cannot style QDial, and QSlider is the only one we want styled, with
our separate customizations for QScrollbar.

Closes #53.
2022-05-02 13:46:11 -05:00
Alex Huszagh 0892fa9b11 Prioritize more important info in README. 2022-05-02 13:34:15 -05:00
Alex Huszagh cc3a7ef472 Documented QDial stylesheet issues.
Added `QDial` styling to known issues, and added a drop-in replacement for `QDial` (subclassing it) that consistently styles over all platforms and application styles.

Closes #42.
2022-05-02 13:28:37 -05:00
Alex Huszagh b37e73bd36 Change QSlider to QAbstractSlider. 2022-05-01 15:55:16 -05:00
Alex Huszagh 6358a38273 Bug fix for test suite in Qt6. 2022-05-01 14:55:13 -05:00
Alex Huszagh 94c1b04583 Enhancements and bug fixes for test suite.
Add ability to start at given test. Fix bugs in 2 tests.
2022-05-01 14:43:45 -05:00
Alex Huszagh eaa5e1013a Make title for test suite more descriptive. 2022-05-01 14:30:14 -05:00
Alex Huszagh 49d44916ed Fix drop-down icon for QDateEdit with the calendar popup.
Weirdly, this is controlled via QAbstractSpinBox and the arrow
indicators, which is fixed by setting a `width` and `height` for those
subcontrols. This makes little sense, since the calendar popup is styled
using QStyle.CC_ComboBox, but it works reliable for Qt5 and Qt6.

Closes #40.
2022-05-01 14:26:54 -05:00
Alex Huszagh fb3a789dc3 Bug fix for QCalendarWidget in QDateTimeEdit.
Fixes the year drop-down menu to properly be styled, via the
`qt_datetimedit_calendar` object name.
2022-05-01 12:43:57 -05:00
Alex Huszagh 9655e7da32 Fix styles for triangular QTabBars.
Added padding to properly pad text on the tab bar. Added negative
padding to avoid clipping the close button, without it overlapping with
the border. Added highlighting for the selected tav. Added
documentation for known bugs with padding south tabs, and color/outline
for selected tabs.

Closes #48.
Closes #50.
2022-05-01 12:07:07 -05:00
Alex Huszagh 90d9658b71 Added utility to print available tests. 2022-05-01 10:23:30 -05:00
Alex Huszagh f59f881798 Update README documentation for plugins/overview.
Update the overview description to simplify and better describe the
stylesheet overview. Update the testing documentation. Add a section for
plugins with links to the plugin code.
2022-05-01 10:08:16 -05:00
Alex Huszagh dac2e86ef1 Fixed network drive icon. 2022-05-01 02:39:22 -05:00
Alex Huszagh a0bc755c94 Fixed hard drive icon. 2022-05-01 02:34:32 -05:00
Alex Huszagh d6c6f65a55 Update titlebar close icon. 2022-05-01 01:58:14 -05:00
Alex Huszagh 1bcde40657 Fix file dialog and browser icons for lower resoluton displays. 2022-05-01 01:18:31 -05:00
Alex Huszagh a694f3164c All extension discovery without stylesheets. 2022-05-01 01:17:19 -05:00
Alex Huszagh d6537888e7 Provide a complete standard icon set.
Provides pixmaps for all Qt standard icons, as an extension, with
descriptions on how to use QCommonStyle to override the default standard
icons. This provides a consistent look and feel on all apps.
2022-04-30 22:33:04 -05:00
Alex Huszagh 92bc22b70e Allow optional stylesheets in extensions. 2022-04-30 17:15:41 -05:00
Alex Huszagh eac6429258 Add more standard icons to example.
Separate overwritten and non-overwritten icons so it's easier to
describe the icons.
2022-04-30 17:10:33 -05:00
Alex Huszagh 5cf73e10c3 Added plugin README. 2022-04-30 16:33:28 -05:00
Alex Huszagh cc504bf73a Added example of styling QSlider ticks.
Added references to bugs with QSlider tick styling with stylesheets,
along with example workarounds.

Closes #43.
2022-04-30 15:28:39 -05:00
Alex Huszagh 52686dd40c Added example workaround for placeholder text.
Added an example PyQt6 application with a workaround to attempt to fix
the placeholder text color issues, which further supports the idea that
it is a Qt bug, and not a stylesheet issue.

Using `QtGui.QPalette.ColorRole.PlaceholderText`, we are able to modify
the placeholder text color in Qt5, but not in Qt6.

Closes #41.
Closes #44.
2022-04-30 14:26:01 -05:00
Alex Huszagh 744571ebae Added unittests for comprehensive widget coverage.
Added file to specify unittest coverage, and added numerous unittests.
2022-04-30 13:31:01 -05:00
Alex Huszagh 48b7d6d75d Fix QCalendarWidget.
Fixes the QToolButton views for the QCalendarWidget, displaying the
desired behavior for both the month and year select. Also fixes the
icons for the QPrevNextCalButton (a subclass of QToolButton) to fix the
next and previous icons. Also, Qt6 now has the menu-arrow correctly
displayed.

Fixes #39.
2022-04-29 15:55:37 -05:00
Alex Huszagh 42b1cf7f55 Added unittests for ToolButtonStyle.
Added tests for both auto-raised and not auto-raised QToolButtons with
all ToolButtonStyles.
2022-04-29 12:58:40 -05:00
Alex Huszagh 0377357dc0 Added unittests for auto-raised QToolButtons.
Added unittests for different arrow types both auto-raised and not.
2022-04-29 12:38:17 -05:00
Alex Huszagh aeb45a3e91 Added example for #38. 2022-04-29 11:52:10 -05:00
Alex Huszagh 9ed3ed5e86 Update README sections to better describe extending stylesheets. 2022-04-29 11:45:08 -05:00
Alex Huszagh 0e3d5150c1 Add example of overwriting standard icons.
Added `example/standard_icons.py` which subclasses `QCommonStyle` to
override standard icons, while keeping the default style. This respects
the stylesheet, while allowing custom standard icons. Added this example
to the documentation.

Closes #33.
2022-04-29 11:40:45 -05:00
Alex Huszagh 3131987eb7 Added pull request templates. 2022-04-29 09:55:58 -05:00
Alex Huszagh 8a834231a2 Add issue template for bug report. 2022-04-29 09:50:55 -05:00
Alex Huszagh 0012c78599 Add issue templates. 2022-04-29 09:41:37 -05:00
Alex Huszagh 1ea115e266 Fix table sort indicator and padding.
Ensures table sort indicator is present on the right, is always visible by clipping just the right amount of content, and fixes the padding issues with the tables before. If the sort indicator is not present, there is no clipping.

Closes #35.
2022-04-29 09:32:33 -05:00
Alex Huszagh c29d290eb8 Fix padding in QHeaderView sections.
Also patches the workaround for #31, by avoiding any hacks to get the desired behavior. Sets the `subcontrol-origin` to `margin` and `subcontrol-position` to `right`, and uses `::up-arrow` and `::down-arrow` subcontrols only when `showSortIndicator="true"`.

Closes #37.
2022-04-29 09:22:09 -05:00