Commit 7af16dc4 authored by Jonathan Marten's avatar Jonathan Marten

Folder View icons properties: Improve visual layout

Differential Revision: https://phabricator.kde.org/D8563
parent 0ff287e0
......@@ -61,292 +61,385 @@ Item {
onIconNameChanged: cfg_icon = iconName || "folder"
}
ColumnLayout {
GroupBox {
id: panelButtonGroupBox
GridLayout {
Layout.fillWidth: true
// Row 0: "Panel button"
Label {
Layout.row: 0
Layout.column: 0
visible: isPopup
text: i18n("Panel button:")
}
CheckBox {
id: useCustomIcon
Layout.row: 0
Layout.column: 1
Layout.columnSpan: 2
visible: isPopup
checked: cfg_useCustomIcon
text: i18n("Use a custom icon")
}
title: i18n("Panel Button")
RowLayout {
Layout.row: 0
Layout.column: 3
Layout.alignment: Qt.AlignRight
spacing: units.smallSpacing
flat: true
visible: isPopup
RowLayout {
spacing: units.smallSpacing
Button {
id: iconButton
Layout.minimumWidth: units.iconSizes.large + units.smallSpacing * 2
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: Layout.minimumWidth
Layout.maximumHeight: Layout.minimumWidth
CheckBox {
id: useCustomIcon
checkable: true
enabled: useCustomIcon.checked
checked: cfg_useCustomIcon
onClicked: {
checked = Qt.binding(function() {
return iconMenu.status === PlasmaComponents.DialogStatus.Open;
})
text: i18n("Custom icon:")
iconMenu.open(0, height);
}
Button {
id: iconButton
Layout.minimumWidth: units.iconSizes.large + units.smallSpacing * 2
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: Layout.minimumWidth
Layout.maximumHeight: Layout.minimumWidth
checkable: true
onClicked: {
checked = Qt.binding(function() {
return iconMenu.status === PlasmaComponents.DialogStatus.Open;
})
iconMenu.open(0, height);
}
PlasmaCore.IconItem {
anchors.centerIn: parent
width: units.iconSizes.large
height: width
source: cfg_icon
}
PlasmaCore.IconItem {
anchors.centerIn: parent
width: units.iconSizes.large
height: width
source: cfg_icon
}
}
PlasmaComponents.ContextMenu {
id: iconMenu
visualParent: iconButton
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...")
icon: "document-open-folder"
onClicked: iconDialog.open()
}
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon: "edit-clear"
onClicked: cfg_icon = "folder"
}
PlasmaComponents.ContextMenu {
id: iconMenu
visualParent: iconButton
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...")
icon: "document-open-folder"
onClicked: iconDialog.open()
}
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon: "edit-clear"
onClicked: cfg_icon = "folder"
}
}
}
GroupBox {
id: arrangementGroupBox
// Row 1: Spacing
Item {
Layout.row: 1
Layout.column: 0
Layout.minimumHeight: units.largeSpacing
visible: isPopup
}
Layout.fillWidth: true
// Row 2: "Arrangment" - "Arrange in"
Label {
Layout.row: 2
Layout.column: 0
visible: !isPopup
text: i18n("Arrangement:")
}
title: i18n("Arrangement")
Label {
Layout.row: 2
Layout.column: 1
flat: true
text: i18n("Arrange in")
}
ColumnLayout {
Layout.fillWidth: true
ComboBox {
id: arrangement
Layout.row: 2
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
RowLayout {
Label {
text: i18n("Arrange in:")
}
model: [i18n("Rows"), i18n("Columns")]
}
ComboBox {
id: arrangement
// Row 3: "Arrangment" - "Align"
Label {
Layout.row: 3
Layout.column: 1
model: [i18n("Rows"), i18n("Columns")]
}
}
text: i18n("Align")
}
RowLayout {
Label {
text: i18n("Align:")
}
ComboBox {
id: alignment
Layout.row: 3
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
ComboBox {
id: alignment
model: [i18n("Left"), i18n("Right")]
}
model: [i18n("Left"), i18n("Right")]
}
}
// Row 4: "Arrangment" - "Lock"
CheckBox {
id: locked
Layout.row: 4
Layout.column: 1
Layout.columnSpan: 3
CheckBox {
id: locked
visible: ("containmentType" in plasmoid)
visible: ("containmentType" in plasmoid)
text: i18n("Lock in place")
}
text: i18n("Lock in place")
}
}
// Row 5: Spacing
Item {
Layout.row: 5
Layout.column: 0
Layout.minimumHeight: units.largeSpacing
}
GroupBox {
id: sortingGroupBox
// Row 6: "Sorting" - "Sort by"
Label {
Layout.row: 6
Layout.column: 0
Layout.fillWidth: true
text: i18n("Sorting:")
}
title: i18n("Sorting")
Label {
Layout.row: 6
Layout.column: 1
flat: true
text: i18n("Sort by")
}
ColumnLayout {
RowLayout {
Label {
text: i18n("Sorting:")
}
ComboBox {
id: sortMode
Layout.row: 6
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
ComboBox {
id: sortMode
property int mode
// FIXME TODO HACK: This maps the combo box list model to the KDirModel::ModelColumns
// enum, which should be done in C++.
property variant indexToMode: [-1, 0, 1, 6, 2]
property variant modeToIndex: {'-1' : '0', '0' : '1', '1' : '2', '6' : '3', '2' : '4'}
property int mode
// FIXME TODO HACK: This maps the combo box's list model to the KDirModel::ModelColumns
// enum, which should be done in C++.
property variant indexToMode: [-1, 0, 1, 6, 2]
property variant modeToIndex: {'-1' : '0', '0' : '1', '1' : '2', '6' : '3', '2' : '4'}
model: [i18n("Unsorted"), i18n("Name"), i18n("Size"), i18n("Type"), i18n("Date")]
model: [i18n("Unsorted"), i18n("Name"), i18n("Size"), i18n("Type"), i18n("Date")]
Component.onCompleted: currentIndex = modeToIndex[mode]
onActivated: mode = indexToMode[index]
}
Component.onCompleted: currentIndex = modeToIndex[mode]
onActivated: mode = indexToMode[index]
}
}
// Row 7: "Sorting" - "Descending"
CheckBox {
id: sortDesc
Layout.row: 7
Layout.column: 1
Layout.columnSpan: 3
CheckBox {
id: sortDesc
enabled: (sortMode.currentIndex != 0)
enabled: (sortMode.currentIndex != 0)
text: i18n("Descending")
}
text: i18n("Descending")
}
// Row 8: "Sorting" - "Directories first"
CheckBox {
id: sortDirsFirst
Layout.row: 8
Layout.column: 1
Layout.columnSpan: 3
CheckBox {
id: sortDirsFirst
enabled: (sortMode.currentIndex != 0)
enabled: (sortMode.currentIndex != 0)
text: i18n("Folders first")
}
text: i18n("Folders first")
}
}
// Row 9: Spacing
Item {
Layout.row: 9
Layout.column: 0
Layout.minimumHeight: units.largeSpacing
}
GroupBox {
id: appearanceGroupBox
// Row 10: "Appearance" - "View mode"
Label {
Layout.row: (isPopup ? 10 : 11)
Layout.column: 0
text: i18n("Appearance:")
}
Label {
Layout.row: 10
Layout.column: 1
visible: isPopup
text: i18nc("whether to use icon or list view", "View mode")
}
ComboBox {
id: viewMode
Layout.row: 10
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
title: i18n("Appearance")
visible: isPopup
flat: true
model: [i18n("List"), i18n("Icons")]
}
ColumnLayout {
RowLayout {
visible: isPopup
// Rows 11+12: "Appearance" - "Size"
Label {
Layout.row: 11
Layout.column: 1
Label {
text: i18nc("whether to use icon or list view", "View Mode:")
}
visible: !isPopup || viewMode.currentIndex === 1
ComboBox {
id: viewMode
model: [i18n("List"), i18n("Icons")]
}
}
text: i18n("Size")
}
RowLayout {
visible: !isPopup || viewMode.currentIndex === 1
Slider {
id: iconSize
Layout.row: 11
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
Label {
text: i18n("Size:")
}
visible: !isPopup || viewMode.currentIndex === 1
Label {
text: i18n("Small")
}
minimumValue: 0
maximumValue: 5
stepSize: 1
tickmarksEnabled: true
}
Slider {
id: iconSize
Label {
Layout.row: 12
Layout.column: 2
Layout.alignment: Qt.AlignLeft
minimumValue: 0
maximumValue: 5
stepSize: 1
visible: !isPopup || viewMode.currentIndex === 1
tickmarksEnabled: true
}
text: i18n("Small")
}
Label {
text: i18n("Large")
}
}
Label {
Layout.row: 12
Layout.column: 3
Layout.alignment: Qt.AlignRight
RowLayout {
visible: !isPopup || viewMode.currentIndex === 1
visible: !isPopup || viewMode.currentIndex === 1
Label {
text: i18n("Text lines:")
}
text: i18n("Large")
}
SpinBox {
id: textLines
// Row 13: "Appearance" - "Text lines"
Label {
Layout.row: 13
Layout.column: 1
minimumValue: 1
maximumValue: 10
stepSize: 1
}
}
visible: !isPopup || viewMode.currentIndex === 1
}
text: i18n("Text lines")
}
GroupBox {
id: behaviorGroupBox
SpinBox {
id: textLines
Layout.row: 13
Layout.column: 2
Layout.columnSpan: 2
Layout.fillWidth: true
visible: !isPopup || viewMode.currentIndex === 1
title: i18n("Features")
minimumValue: 1
maximumValue: 10
stepSize: 1
}
flat: true
// Row 14: Spacing
Item {
Layout.row: 14
Layout.column: 0
Layout.minimumHeight: units.largeSpacing
}
ColumnLayout {
CheckBox {
id: toolTips
// Row 15: "Features" - "Tool tips"
Label {
Layout.row: 15
Layout.column: 0
text: i18n("Tooltips")
}
text: i18n("Features:")
}
CheckBox {
id: toolTips
Layout.row: 15
Layout.column: 1
Layout.columnSpan: 3
CheckBox {
id: selectionMarkers
text: i18n("Tool tips")
}
visible: Qt.styleHints.singleClickActivation
// Row 16: "Features" - "Selection markers"
CheckBox {
id: selectionMarkers
Layout.row: 16
Layout.column: 1
Layout.columnSpan: 3
text: i18n("Selection markers")
}
visible: Qt.styleHints.singleClickActivation
CheckBox {
id: popups
text: i18n("Selection markers")
}
visible: !isPopup
// Row 17: "Features" - "Folder preview popups"
CheckBox {
id: popups
Layout.row: 17
Layout.column: 1
Layout.columnSpan: 3
text: i18n("Folder preview popups")
}
visible: !isPopup
RowLayout {
CheckBox {
id: previews
text: i18n("Folder preview popups")
}
text: i18n("Preview thumbnails")
}
// Rows 18+19: "Features" - "Preview thumbnails"
CheckBox {
id: previews
Layout.row: 18
Layout.column: 1
Layout.columnSpan: 3
Button {
id: previewSettings
text: i18n("Preview thumbnails")
}
text: i18n("More Preview Options...")
Button {
id: previewSettings
Layout.row: 19
Layout.column: 3
Layout.alignment: Qt.AlignRight
onClicked: {
previewPluginsDialog.visible = true;
}
}
}
text: i18n("More Preview Options...")
onClicked: {
previewPluginsDialog.visible = true;
}
}
}
FolderItemPreviewPluginsDialog {
id: previewPluginsDialog
}
FolderItemPreviewPluginsDialog {
id: previewPluginsDialog
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment