Skip to content

Commit

Permalink
[ui] Custom SplitView to have a larger handle
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Sep 19, 2024
1 parent ccd88c4 commit 2852a4c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
5 changes: 3 additions & 2 deletions meshroom/ui/qml/Application.qml
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,8 @@ Page {
highlightChunks: false
}

SplitView {
MSplitView {
id: topBottomSplit
Layout.fillHeight: true
width: parent.width

Expand Down Expand Up @@ -1032,7 +1033,7 @@ Page {
}
}

SplitView {
MSplitView {
id: bottomContainer
orientation: Qt.Horizontal
visible: settingsUILayout.showGraphEditor
Expand Down
23 changes: 23 additions & 0 deletions meshroom/ui/qml/Controls/MSplitView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

SplitView {
id: splitView

handle: Item {
id: handleDelegate
implicitWidth: 5
implicitHeight: 5
property bool hovered: SplitHandle.hovered
property bool pressed: SplitHandle.pressed
Rectangle {
id: handleDisplay
anchors.centerIn: parent
property int handleSize: handleDelegate.hovered ? 3 : 1
width: splitView.orientation === Qt.Horizontal ? handleSize : handleDelegate.width
height: splitView.orientation === Qt.Vertical ? handleSize : handleDelegate.height
color: handleDelegate.pressed ? Qt.lighter(palette.highlight, 1.5)
: (handleDelegate.hovered ? palette.highlight : palette.base)
}
}
}
1 change: 1 addition & 0 deletions meshroom/ui/qml/Controls/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ ExifOrientedViewer 1.0 ExifOrientedViewer.qml
FilterComboBox 1.0 FilterComboBox.qml
IntSelector 1.0 IntSelector.qml
MScrollBar 1.0 MScrollBar.qml
MSplitView 1.0 MSplitView.qml
2 changes: 1 addition & 1 deletion meshroom/ui/qml/GraphEditor/NodeEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Panel {
Component {
id: editor_component

SplitView {
MSplitView {
anchors.fill: parent

// The list of chunks
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/Homepage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Page {
}
}

SplitView {
MSplitView {
id: splitView
anchors.fill: parent

Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/qml/WorkspaceView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Item {

SystemPalette { id: activePalette }

SplitView {
MSplitView {
id: mainSplitView
anchors.fill: parent

SplitView {
MSplitView {
id: leftSplitView
visible: settingsUILayout.showImageGallery || settingsUILayout.showLiveReconstruction
orientation: Qt.Vertical
Expand Down Expand Up @@ -215,7 +215,7 @@ Item {

property alias viewer3D: c_viewer3D

SplitView {
MSplitView {
id: c_viewer3DSplitView
anchors.fill: parent
Viewer3D {
Expand Down

0 comments on commit 2852a4c

Please sign in to comment.