Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion qt6/src/qml/ScrollBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ T.ScrollBar {

padding: DS.Style.scrollBar.padding
visible: control.policy !== T.ScrollBar.AlwaysOff
policy: D.DTK.platformTheme.scrollBarPolicy

state: "hide"
states: [
State {
name: "hide"
when: control.policy === T.ScrollBar.AlwaysOff || !control.active || control.size >= 1.0
when: control.policy === T.ScrollBar.AlwaysOff || (control.policy !== T.ScrollBar.AlwaysOn && (!control.active || control.size >= 1.0))
PropertyChanges {
target: control.contentItem
implicitWidth: DS.Style.scrollBar.width
Expand Down
7 changes: 7 additions & 0 deletions src/dplatformthemeproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ DPlatformThemeProxy::DPlatformThemeProxy(DPlatformTheme *proxy, QObject *parent)
connect(proxy, &DPlatformTheme::darkLivelyChanged, this, &DPlatformThemeProxy::darkLivelyChanged);
connect(proxy, &DPlatformTheme::frameBorderChanged, this, &DPlatformThemeProxy::frameBorderChanged);
#endif
connect(proxy, &DPlatformTheme::scrollBarPolicyChanged, this, &DPlatformThemeProxy::scrollBarPolicyChanged);

// theme
connect(proxy, &DPlatformTheme::themeNameChanged, this, &DPlatformThemeProxy::themeNameChanged);
Expand Down Expand Up @@ -390,6 +391,12 @@ QColor DPlatformThemeProxy::frameBorder() const
}
#endif

int DPlatformThemeProxy::scrollBarPolicy() const
{
D_DC(DPlatformThemeProxy);
return d->proxy->scrollBarPolicy();
}

int DPlatformThemeProxy::dotsPerInch(const QString &screenName) const
{
D_DC(DPlatformThemeProxy);
Expand Down
3 changes: 3 additions & 0 deletions src/dplatformthemeproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class DPlatformThemeProxy : public QObject, public DTK_CORE_NAMESPACE::DObject
Q_PROPERTY(QColor darkLively READ darkLively WRITE setDarkLively NOTIFY darkLivelyChanged)
Q_PROPERTY(QColor frameBorder READ frameBorder WRITE setFrameBorder NOTIFY frameBorderChanged)
#endif
Q_PROPERTY(int scrollBarPolicy READ scrollBarPolicy NOTIFY scrollBarPolicyChanged)

public:
explicit DPlatformThemeProxy(DPlatformTheme *proxy, QObject *parent = nullptr);
Expand Down Expand Up @@ -122,6 +123,7 @@ class DPlatformThemeProxy : public QObject, public DTK_CORE_NAMESPACE::DObject
QColor darkLively() const;
QColor frameBorder() const;
#endif
int scrollBarPolicy() const;

Q_INVOKABLE int dotsPerInch(const QString &screenName = QString()) const;

Expand Down Expand Up @@ -220,6 +222,7 @@ public Q_SLOTS:
#endif
void dotsPerInchChanged(const QString &screen, int dpi);
void windowRadiusChanged(int r);
void scrollBarPolicyChanged();

private:
D_DECLARE_PRIVATE(DPlatformThemeProxy)
Expand Down
Loading