mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
@@ -23,45 +23,48 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "swap_vert"
|
iconName: "swap_vert"
|
||||||
title: I18n.tr("Dock Position")
|
title: I18n.tr("Position")
|
||||||
settingKey: "dockPosition"
|
settingKey: "dockPosition"
|
||||||
|
|
||||||
SettingsButtonGroupRow {
|
Item {
|
||||||
text: I18n.tr("Position")
|
width: parent.width
|
||||||
model: [I18n.tr("Top", "dock position option"), I18n.tr("Bottom", "dock position option"), I18n.tr("Left", "dock position option"), I18n.tr("Right", "dock position option")]
|
height: dockPositionButtonGroup.height
|
||||||
buttonPadding: Theme.spacingS
|
|
||||||
minButtonWidth: 44
|
DankButtonGroup {
|
||||||
textSize: Theme.fontSizeSmall
|
id: dockPositionButtonGroup
|
||||||
currentIndex: {
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
switch (SettingsData.dockPosition) {
|
model: [I18n.tr("Top"), I18n.tr("Bottom"), I18n.tr("Left"), I18n.tr("Right")]
|
||||||
case SettingsData.Position.Top:
|
currentIndex: {
|
||||||
return 0;
|
switch (SettingsData.dockPosition) {
|
||||||
case SettingsData.Position.Bottom:
|
case SettingsData.Position.Top:
|
||||||
return 1;
|
return 0;
|
||||||
case SettingsData.Position.Left:
|
case SettingsData.Position.Bottom:
|
||||||
return 2;
|
return 1;
|
||||||
case SettingsData.Position.Right:
|
case SettingsData.Position.Left:
|
||||||
return 3;
|
return 2;
|
||||||
default:
|
case SettingsData.Position.Right:
|
||||||
return 1;
|
return 3;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
onSelectionChanged: (index, selected) => {
|
||||||
onSelectionChanged: (index, selected) => {
|
if (!selected)
|
||||||
if (!selected)
|
return;
|
||||||
return;
|
switch (index) {
|
||||||
switch (index) {
|
case 0:
|
||||||
case 0:
|
SettingsData.setDockPosition(SettingsData.Position.Top);
|
||||||
SettingsData.setDockPosition(SettingsData.Position.Top);
|
break;
|
||||||
break;
|
case 1:
|
||||||
case 1:
|
SettingsData.setDockPosition(SettingsData.Position.Bottom);
|
||||||
SettingsData.setDockPosition(SettingsData.Position.Bottom);
|
break;
|
||||||
break;
|
case 2:
|
||||||
case 2:
|
SettingsData.setDockPosition(SettingsData.Position.Left);
|
||||||
SettingsData.setDockPosition(SettingsData.Position.Left);
|
break;
|
||||||
break;
|
case 3:
|
||||||
case 3:
|
SettingsData.setDockPosition(SettingsData.Position.Right);
|
||||||
SettingsData.setDockPosition(SettingsData.Position.Right);
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user