diff --git a/src/qml/ContentView.qml b/src/qml/ContentView.qml --- a/src/qml/ContentView.qml +++ b/src/qml/ContentView.qml @@ -40,8 +40,28 @@ id: listViews Layout.fillHeight: true - Layout.preferredWidth: mainWindow.width * 0.15 - Layout.maximumWidth: mainWindow.width * 0.15 + Layout.preferredWidth: mainWindow.width * 0.11 + Layout.maximumWidth: mainWindow.width * 0.11 + } + + Rectangle { + id: viewSelectorSeparatorItem + + border.width: 1 + border.color: myPalette.mid + color: myPalette.mid + visible: true + + Layout.bottomMargin: elisaTheme.layoutVerticalMargin + Layout.topMargin: elisaTheme.layoutVerticalMargin + + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + + Layout.fillHeight: true + + Layout.preferredWidth: 1 + Layout.minimumWidth: 1 + Layout.maximumWidth: 1 } ColumnLayout { diff --git a/src/qml/Theme.qml b/src/qml/Theme.qml --- a/src/qml/Theme.qml +++ b/src/qml/Theme.qml @@ -79,7 +79,7 @@ property int gridDelegateHeight: dp(100) + layoutVerticalMargin + fontSize.height * 2 property int gridDelegateWidth: dp(100) - property int viewSelectorDelegateHeight: dp(32) + property int viewSelectorDelegateHeight: dp(24) property int filterClearButtonMargin: layoutVerticalMargin diff --git a/src/qml/ViewSelector.qml b/src/qml/ViewSelector.qml --- a/src/qml/ViewSelector.qml +++ b/src/qml/ViewSelector.qml @@ -29,30 +29,28 @@ Rectangle { anchors.fill: parent - color: myPalette.window + color: myPalette.base border { - color: (rootFocusScope.activeFocus ? myPalette.highlight : myPalette.window) + color: (rootFocusScope.activeFocus ? myPalette.highlight : "transparent") width: 1 } ScrollView { focus: true anchors.fill: parent + clip: true + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + + ListView { id: viewModeView focus: true z: 2 - highlight: Rectangle { - id: item - - height: elisaTheme.viewSelectorDelegateHeight * 1.4 - width: viewModeView.width - color: myPalette.highlight - } + anchors.topMargin: elisaTheme.layoutHorizontalMargin * 2 model: DelegateModel { id: pageDelegateModel @@ -70,20 +68,6 @@ hoverEnabled: true acceptedButtons: Qt.LeftButton - Rectangle { - anchors.fill: parent - - z: 1 - - color: ((item.containsMouse && index !== viewModeView.currentIndex) ? myPalette.mid : "transparent") - - Behavior on color { - ColorAnimation { - duration: 200 - } - } - } - Image { id: viewIcon @@ -122,7 +106,7 @@ height: elisaTheme.viewSelectorDelegateHeight width: elisaTheme.viewSelectorDelegateHeight - color: (index === viewModeView.currentIndex ? myPalette.highlightedText : "transparent") + color: (index === viewModeView.currentIndex || item.containsMouse ? myPalette.highlight : "transparent") Behavior on color { ColorAnimation { @@ -148,7 +132,7 @@ text: model.name elide: Text.ElideRight - color: (viewModeView.currentIndex === index ? myPalette.highlightedText : myPalette.text) + color: (viewModeView.currentIndex === index || item.containsMouse ? myPalette.highlight : myPalette.text) Behavior on color { ColorAnimation {