Fix slider handle height

pull/19/head
reionwong 4 years ago
parent 57eef2b3a6
commit 1b95cfc4bd

@ -30,6 +30,8 @@ Item {
height: size
width: size
property alias background: _background
property color backgroundColor: "transparent"
property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 2)
: Qt.darker(FishUI.Theme.backgroundColor, 1.2)
property color pressedColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.5)
@ -39,11 +41,11 @@ Item {
signal clicked()
Rectangle {
id: background
id: _background
anchors.fill: parent
anchors.margins: size * 0.1
radius: control.height / 2
color: mouseArea.pressed ? pressedColor : mouseArea.containsMouse ? control.hoveredColor : "transparent"
color: mouseArea.pressed ? pressedColor : mouseArea.containsMouse ? control.hoveredColor : control.backgroundColor
}
MouseArea {

@ -36,6 +36,7 @@ Window {
default property alias content : _content.data
property alias background: _background
property alias header: _header
property alias headerBackground: _headerBackground
property Item headerItem
// Window helper
@ -234,11 +235,17 @@ Window {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
height: 40
height: 35
property int buttonSize: 32
property int buttonSize: 31
property int spacing: (_header.height - _header.buttonSize) / 2
Rectangle {
id: _headerBackground
anchors.fill: parent
color: "transparent"
}
TapHandler {
enabled: !control.isFullScreen
onTapped: if (tapCount === 2) toggleMaximized()

@ -14,10 +14,11 @@ singleton Units 1.0 Units.qml
ActionTextField 1.0 ActionTextField
BusyIndicator 1.0 BusyIndicator.qml
DesktopMenu 1.0 DesktopMenu.qml
Dialog 1.0 Dialog.qml
Icon 1.0 Icon.qml
PopupTips 1.0 PopupTips.qml
RoundedRect 1.0 RoundedRect.qml
Window 1.0 Window.qml
WindowButton 1.0 WindowButton.qml
RoundImageButton 1.0 RoundImageButton.qml
Toast 1.0 Toast.qml
DesktopMenu 1.0 DesktopMenu.qml

@ -9,7 +9,7 @@ T.Slider {
property int sliderTrackHeight: 5
implicitWidth: background.implicitWidth
implicitHeight: background.implicitHeight
implicitHeight: 22
snapMode: T.Slider.SnapOnRelease
handle: Rectangle {
@ -17,7 +17,7 @@ T.Slider {
x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
width: 26
width: control.implicitHeight
height: width
radius: width / 2
opacity: 1
@ -38,8 +38,8 @@ T.Slider {
}
background: Item {
implicitWidth: control.horizontal ? 200 : 16
implicitHeight: control.horizontal ? 16 : 200
implicitWidth: control.horizontal ? 200 : control.implicitHeight
implicitHeight: control.horizontal ? control.implicitHeight : 200
x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2)
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0)

@ -131,7 +131,7 @@ void WindowBlur::updateBlur()
if (m_enabled) {
qreal devicePixelRatio = m_view->screen()->devicePixelRatio();
QPainterPath path;
path.addRoundedRect(QRect(QPoint(0, 0), m_view->size() * devicePixelRatio),
path.addRoundedRect(QRectF(QPoint(0, 0), m_view->size() * devicePixelRatio),
m_windowRadius * devicePixelRatio,
m_windowRadius * devicePixelRatio);
QVector<uint32_t> data;

Loading…
Cancel
Save