region selector: make mode selection animated

This commit is contained in:
end-4
2025-11-03 18:27:47 +01:00
parent 519de4f5ba
commit 4270d2fe56
@@ -65,18 +65,16 @@ Toolbar {
} }
} }
IconAndTextToolbarButton { ToolbarTabBar {
iconText: "activity_zone" id: tabBar
text: Translation.tr("Rect") tabButtonList: [
toggled: root.selectionMode === RegionSelection.SelectionMode.RectCorners {"icon": "activity_zone", "name": Translation.tr("Rect")},
onClicked: root.selectionMode = RegionSelection.SelectionMode.RectCorners {"icon": "gesture", "name": Translation.tr("Circle")}
} ]
currentIndex: root.selectionMode === RegionSelection.SelectionMode.RectCorners ? 0 : 1
IconAndTextToolbarButton { onCurrentIndexChanged: {
iconText: "gesture" root.selectionMode = currentIndex === 0 ? RegionSelection.SelectionMode.RectCorners : RegionSelection.SelectionMode.Circle;
text: Translation.tr("Circle") }
toggled: root.selectionMode === RegionSelection.SelectionMode.Circle
onClicked: root.selectionMode = RegionSelection.SelectionMode.Circle
} }
} }