Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-toou2d/build-preset/plugin.qmltypes
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,7 @@ Module {
Property { name: "activeItemLabel"; type: "TGadgetLabel"; isReadonly: true; isPointer: true }
Property { name: "itemIcon"; type: "TGadgetIcon"; isReadonly: true; isPointer: true }
Property { name: "activeItemIcon"; type: "TGadgetIcon"; isReadonly: true; isPointer: true }
Property { name: "itemHeight"; type:"int"; isReadonly: true; isPointer: true }
Signal {
name: "triggered"
Parameter { name: "modelData"; type: "QVariant" }
Expand Down
23 changes: 16 additions & 7 deletions src-toou2d/controls/TNavigationBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,19 @@ Item {
backgroundComponent: null;
theme.enabled: false;

label.text : modelData.text ? modelData.text : modelData.index;
label.text : modelData_p.text ? modelData_p.text : modelData_p.index;
label.color: isActiveItem ? mactiveLabel.color : mlabel.color;
label.font: isActiveItem ? mactiveLabel.font : mlabel.font;

icon.source: modelData.iconSource;
icon.source: modelData_p.iconSource;
icon.color: isActiveItem ? mactiveIcon.color : micon.color;
icon.width: isActiveItem ? mactiveIcon.width : micon.width;
icon.height: isActiveItem ? mactiveIcon.height : micon.height;
icon.position: isActiveItem ? mactiveIcon.position : micon.position;

onClicked: {
toou2d_navigationbar.currentIndex = modelData.index;
triggered(modelData);
toou2d_navigationbar.currentIndex = index_p;
triggered(modelData_p);
}

Timer {
Expand All @@ -104,13 +105,15 @@ Item {
TGadgetIcon{
id:micon;
color: "#303133"
position: TPosition.Left
}

TGadgetIcon{
id:mactiveIcon;
color: "#000"
width: 20;
height: 20;
position: TPosition.Left
}

TObject{
Expand All @@ -124,9 +127,11 @@ Item {
spacing: toou2d_navigationbar.spacing;
Repeater{
id:repeater
model: ListModel{ }
model: []
delegate: Loader{
property var modelData: model;
property var modelData_p: modelData;
property var index_p: index;

property bool isActiveItem: toou2d_navigationbar.currentIndex === index;

anchors.verticalCenter: parent.verticalCenter;
Expand All @@ -136,8 +141,12 @@ Item {
}

Component.onCompleted: {
for(var i in _private.elements) repeater.model.append(_private.elements[i]);
var a = []
for(var i in _private.elements) a.push(_private.elements[i]);
repeater.model = a;

if(_private.elements.length > 0 && currentIndex === -1) currentIndex = 0;

}

TThemeBinder{
Expand Down
4 changes: 3 additions & 1 deletion src-toou2d/controls/TPopoverMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ TPopover{
padding: 8;

bodyWidth: 150;
property int itemHeight: 30;

bodyComponent: menubodyComponent;

Expand Down Expand Up @@ -82,6 +83,7 @@ TPopover{
id:mItemIcon
}


TGadgetIcon{
id:mActItemIcon
color: "#FFF"
Expand Down Expand Up @@ -175,7 +177,7 @@ TPopover{
id:defaultItemComponent;
Item{
property bool active: _mprivate.actieIndex === modelIndex;
height: 26;
height: toou2d_popover.itemHeight;
TRectangle{
anchors.fill: parent;
color: mItemBg.color;
Expand Down