Commit bd7185e1 authored by Camilo higuita's avatar Camilo higuita

moving out form toolbuttons form mauikit too and fix issue with our file dialog

parent 6e4c8a44
......@@ -41,59 +41,55 @@ Maui.ApplicationWindow
headBar.spacing: space.huge
headBar.middleContent: [
Maui.ToolButton
ToolButton
{
// Layout.fillHeight: true
iconName: "nx-home"
colorScheme.textColor : root.headBarFGColor
icon.name: "nx-home"
Kirigami.Theme.textColor : root.headBarFGColor
spacing: space.medium
active: currentPageIndex === 0
showIndicator: true
checked: currentPageIndex === 0
onClicked: currentPageIndex = 0
text: qsTr("Home")
},
Maui.ToolButton
ToolButton
{
// Layout.fillHeight: true
iconName: "view-list-icons"
colorScheme.textColor: root.headBarFGColor
icon.name: "view-list-icons"
Kirigami.Theme.textColor: root.headBarFGColor
spacing: space.medium
active: currentPageIndex === 1
showIndicator: true
checked: currentPageIndex === 1
onClicked: currentPageIndex = 1
text: qsTr("Browser")
},
Maui.ToolButton
ToolButton
{
// Layout.fillHeight: true
iconName: "view-media-genre"
colorScheme.textColor: root.headBarFGColor
icon.name: "view-media-genre"
Kirigami.Theme.textColor: root.headBarFGColor
spacing: space.medium
active: currentPageIndex === 2
showIndicator: true
checked: currentPageIndex === 2
onClicked: currentPageIndex = 2
text: qsTr("Editor")
},
Maui.ToolButton
ToolButton
{
// Layout.fillHeight: true
iconName: "nx-software-center"
colorScheme.textColor: root.headBarFGColor
icon.name: "nx-software-center"
Kirigami.Theme.textColor: root.headBarFGColor
spacing: space.medium
active: currentPageIndex === 3
showIndicator: true
checked: currentPageIndex === 3
onClicked: currentPageIndex = 3
text: qsTr("Store")
}
]
footBar.leftContent: Maui.ToolButton
footBar.leftContent: ToolButton
{
iconName: "view-split-left-right"
icon.name: "view-split-left-right"
onClicked: _drawer.visible = !_drawer.visible
checked: _drawer.visible
}
......@@ -250,9 +246,9 @@ Maui.ApplicationWindow
}
headBar.rightContent: Maui.ToolButton
headBar.rightContent: ToolButton
{
iconName: "documentinfo"
icon.name: "documentinfo"
text: qsTr("Notify")
onClicked:
......@@ -269,11 +265,11 @@ Maui.ApplicationWindow
}
headBar.leftContent: Maui.ToolButton
headBar.leftContent: ToolButton
{
id: _batteryBtn
visible: false
iconName: "battery"
icon.name: "battery"
}
}
......
......@@ -43,23 +43,23 @@ Maui.Dialog
maxWidth: unit * 400
maxHeight: unit * 250
footBar.middleContent: Maui.ToolButton
footBar.middleContent: ToolButton
{
iconName: "view-links"
icon.name: "view-links"
onClicked: Maui.FM.openUrl(control.appLink)
}
footBar.rightContent: Maui.ToolButton
footBar.rightContent: ToolButton
{
iconName: "love"
icon.name: "love"
onClicked: Maui.FM.openUrl(control.appDonation)
}
footBar.leftContent: Maui.ToolButton
footBar.leftContent: ToolButton
{
iconName: "documentinfo"
icon.name: "documentinfo"
}
RowLayout
......
......@@ -305,7 +305,7 @@ backgroundColor.b, 0.7))
margins: space.medium
}
Maui.ComboBox
ComboBox
{
id: _accountCombobox
anchors.centerIn: parent
......@@ -316,8 +316,8 @@ backgroundColor.b, 0.7))
textRole: "user"
flat: true
model: showAccounts ? accounts.model : undefined
iconButton.iconName: "user-identity"
iconButton.isMask: false
// icon.name: "user-identity"
// iconButton.isMask: false
}
}
......
......@@ -54,25 +54,25 @@ ComboBox
Maui.ToolButton
ToolButton
{
id: _iconButton
visible: iconName.length
size: iconSizes.medium
icon.width: iconSizes.medium
enabled: false
iconColor: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor
icon.color: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor
anchors.left: control.left
anchors.verticalCenter: control.verticalCenter
anchors.margins: space.small
}
indicator: Maui.ToolButton
indicator: ToolButton
{
id: _indicatorButton
size: iconSizes.small
icon.width: iconSizes.small
enabled: false
iconName: _popup.visible ? "go-up" : "go-down"
iconColor: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor
icon.name: _popup.visible ? "go-up" : "go-down"
icon.color: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor
anchors.right: control.right
anchors.verticalCenter: control.verticalCenter
anchors.margins: space.small
......
......@@ -133,12 +133,12 @@ Maui.Dialog
}
}
headBar.rightContent: Maui.ToolButton
headBar.rightContent: ToolButton
{
id: searchButton
iconName: "edit-find"
icon.name: "edit-find"
onClicked: searchBar = !searchBar
iconColor: searchBar ? searchButton.colorScheme.highlightColor : searchButton.colorScheme.textColor
checked: searchBar
}
......@@ -148,9 +148,7 @@ Maui.Dialog
anchors.fill: parent
clip: true
property int sidebarWidth: sidebar.isCollapsed ? sidebar.iconSize * 2 :
Kirigami.Units.gridUnit * (isMobile? 15 : 8)
property int sidebarWidth: Kirigami.Units.gridUnit * (isMobile? 15 : 8)
separatorVisible: wideMode
initialPage: [sidebar, content]
defaultColumnWidth: sidebarWidth
......@@ -158,10 +156,7 @@ Maui.Dialog
Maui.PlacesSidebar
{
id: sidebar
width: isCollapsed ? iconSize*2 : parent.width
height: parent.height
id: sidebar
onPlaceClicked:
{
pageRow.currentIndex = 1
......
......@@ -25,10 +25,10 @@ Maui.Dialog
maxWidth: unit * 500
defaultButtons: false
footBar.leftContent: Maui.ToolButton
footBar.leftContent: ToolButton
{
iconColor: control.colorScheme.textColor
iconName: "document-open"
icon.color: control.colorScheme.textColor
icon.name: "document-open"
text: qsTr("Open")
onClicked:
{
......@@ -40,11 +40,11 @@ Maui.Dialog
footBar.middleContent: [
Maui.ToolButton
ToolButton
{
visible: !isDir
iconColor: control.colorScheme.textColor
iconName: "document-share"
icon.color: control.colorScheme.textColor
icon.name: "document-share"
text: qsTr("Share")
onClicked:
......@@ -54,10 +54,10 @@ Maui.Dialog
}
},
Maui.ToolButton
ToolButton
{
iconName: "love"
iconColor: control.colorScheme.textColor
icon.name: "love"
icon.color: control.colorScheme.textColor
text: qsTr("Fav")
......@@ -66,15 +66,15 @@ Maui.Dialog
]
footBar.rightContent: Maui.ToolButton
footBar.rightContent: ToolButton
{
iconName: "documentinfo"
icon.name: "documentinfo"
text: qsTr("Info")
checkable: true
checked: showInfo
onClicked: showInfo = !showInfo
iconColor: control.colorScheme.textColor
icon.color: control.colorScheme.textColor
}
......
......@@ -23,7 +23,7 @@ import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.0 as Kirigami
import "private"
Maui.ToolButton
ToolButton
{
id: control
/* Controlc color scheming */
......
......@@ -34,9 +34,9 @@ Maui.ToolBar
width: 30
signal search(string query)
leftContent: Maui.ToolButton
leftContent: ToolButton
{
iconName: "view-filter"
icon.name: "view-filter"
}
middleContent: Maui.TextField
......@@ -48,9 +48,9 @@ Maui.ToolBar
onAccepted: search(searchInput.text)
}
rightContent : Maui.ToolButton
rightContent : ToolButton
{
iconName: "edit-clear"
icon.name: "edit-clear"
Layout.alignment: Qt.AlignRight
onClicked: searchInput.clear()
}
......
......@@ -64,11 +64,11 @@ Maui.Page
}
footBar.middleContent: [
Maui.ToolButton
ToolButton
{
id: _previousPageButton
iconName: "go-previous"
tooltipText: qsTr("Previous")
icon.name: "go-previous"
text: qsTr("Previous")
enabled: _storeList.contentReady
onClicked:
{
......@@ -88,11 +88,11 @@ Maui.Page
anchors.verticalCenter: _previousPageButton.verticalCenter
},
Maui.ToolButton
ToolButton
{
id: _nextPageButton
iconName: "go-next"
tooltipText: qsTr("Next")
icon.name: "go-next"
text: qsTr("Next")
enabled: _storeList.contentReady
onClicked:
......@@ -111,34 +111,33 @@ Maui.Page
}
footBar.rightContent: [
Maui.ToolButton
ToolButton
{
id:_filterButton
iconName: "view-filter"
iconColor: _filterDrawer.visible ? colorScheme.highlightColor : colorScheme.textColor
icon.name: "view-filter"
icon.color: _filterDrawer.visible ? colorScheme.highlightColor : colorScheme.textColor
onClicked: _filterDrawer.visible ? _filterDrawer.close() : _filterDrawer.open()
}
]
footBar.leftContent: [
Maui.ToolButton
{
iconName: control.detailsView ? "view-list-icons" : "view-list-details"
ToolButton
{
icon.name: control.detailsView ? "view-list-icons" : "view-list-details"
onClicked: control.detailsView = !control.detailsView
},
Maui.ToolButton
ToolButton
{
id:_sortButton
iconName: "view-sort"
icon.name: "view-sort"
onClicked: sortMenu.popup()
Maui.Menu
Menu
{
id: sortMenu
Maui.MenuItem
MenuItem
{
text: qsTr("Title")
checkable: true
......@@ -146,7 +145,7 @@ Maui.Page
onTriggered: _storeList.sortBy = StoreList.LABEL
}
Maui.MenuItem
MenuItem
{
text: qsTr("Rating")
checkable: true
......@@ -154,7 +153,7 @@ Maui.Page
onTriggered: _storeList.sortBy = StoreList.RATE
}
Maui.MenuItem
MenuItem
{
text: qsTr("Downloads")
checkable: true
......@@ -162,7 +161,7 @@ Maui.Page
onTriggered: _storeList.sortBy = StoreList.COUNT
}
Maui.MenuItem
MenuItem
{
text: qsTr("Newest")
checkable: true
......@@ -336,7 +335,7 @@ Maui.Page
rejectButton.visible: false
footBar.rightContent: Maui.Button
footBar.rightContent: Button
{
id: _openButton
text: qsTr("Open...")
......@@ -347,13 +346,12 @@ Maui.Page
}
}
footBar.leftContent: [
footBar.leftContent: [
Maui.ToolButton
ToolButton
{
id: _linkButton
iconName: "view-links"
icon.name: "view-links"
onClicked: Maui.FM.openUrl(_previewerDialog.currentItem.source)
}
]
......
......@@ -38,9 +38,9 @@ Maui.Dialog
maxHeight: unit * 300
maxWidth: maxHeight
footBar.leftContent: Maui.ToolButton
footBar.leftContent: ToolButton
{
iconName: "filename-space-amarok"
icon.name: "filename-space-amarok"
// text: qsTr("Custom server")
checkable: true
checked: customServer
......
......@@ -63,13 +63,13 @@ Item
anchors.fill: parent
spacing: 0
Maui.ToolButton
ToolButton
{
Layout.alignment: Qt.AlignLeft
visible: allowEditMode
iconName: "list-add"
icon.name: "list-add"
onClicked: addClicked()
iconColor: control.Kirigami.Theme.textColor
icon.color: control.Kirigami.Theme.textColor
}
TagList
......@@ -130,10 +130,10 @@ Item
}
}
Maui.ToolButton
ToolButton
{
Layout.alignment: Qt.AlignLeft
iconName: "checkbox"
icon.name: "checkbox"
onClicked: saveTags()
}
}
......
......@@ -22,10 +22,10 @@ Maui.Dialog
onAccepted: setTags()
onRejected: close()
headBar.plegable: false
headBar.leftContent: Maui.ToolButton
headBar.leftContent: ToolButton
{
iconName: "view-sort"
tooltipText: qsTr("Sort by...")
icon.name: "view-sort"
text: qsTr("Sort by...")
onClicked: sortMenu.popup()
Menu
......@@ -69,10 +69,10 @@ Maui.Dialog
}
headBar.rightContent: Maui.ToolButton
headBar.rightContent: ToolButton
{
iconName: "view-refresh"
tooltipText: qsTr("Refresh...")
icon.name: "view-refresh"
// text: qsTr("Refresh...")
onClicked: taglist.refresh()
}
......
......@@ -33,14 +33,13 @@ ColumnLayout
autoPlay: true
}
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
isMask: false
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
iconFallback: "qrc:/assets/application-x-zerosize.svg"
icon.width: iconSizes.huge
icon.name: iteminfo.icon
icon.source: "qrc:/assets/application-x-zerosize.svg"
onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play()
}
......@@ -56,11 +55,11 @@ ColumnLayout
anchors.centerIn: parent
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
iconName: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start"
iconColor: "white"
icon.name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start"
icon.color: "white"
onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play()
}
}
......
......@@ -17,13 +17,12 @@ Item
Layout.preferredHeight: iconSizes.huge + space.big
Layout.margins: contentMargins
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
isMask: false
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
icon.width: iconSizes.huge
icon.name: iteminfo.icon
}
}
......
......@@ -35,14 +35,14 @@ ItemDelegate
}
Maui.ToolButton
ToolButton
{
id: controlIcon
anchors.centerIn: parent
enabled: false
iconName: model.iconName
icon.name: model.iconName
text: model.text
iconColor: isCurrent ? highlightedTextColor : textColor
icon.color: isCurrent ? highlightedTextColor : textColor
}
}
......@@ -156,13 +156,12 @@ ItemDelegate
{
id: iconComponent
Maui.ToolButton
ToolButton
{
iconName: model.icon
iconFallback: "qrc:/assets/application-x-zerosize.svg"
isMask: size <= iconSizes.medium
iconColor: labelColor
size: Math.min(iconSizes.huge, Math.min(control.width, control.height))
icon.name: model.icon
icon.source: "qrc:/assets/application-x-zerosize.svg"
icon.color: (size <= iconSizes.medium ? "transparent" : labelColor)
icon.width: Math.min(iconSizes.huge, Math.min(control.width, control.height))
enabled: false
}
}
......
......@@ -69,14 +69,14 @@ ItemDelegate
Layout.maximumWidth: iconSizes.small
Layout.margins: space.small
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
visible: showDeleteIcon
iconName: "window-close"
size: iconSizes.small
icon.name: "window-close"
icon.width: iconSizes.small
onClicked: removeTag(index)
iconColor: colorScheme.textColor
icon.color: colorScheme.textColor
}
}
......
......@@ -15,13 +15,13 @@ ColumnLayout
Layout.fillHeight: true
Layout.margins: 0
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
isMask: false
icon.color: "transparent"
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
icon.width: iconSizes.huge
icon.name: iteminfo.icon
}
Video
......@@ -52,11 +52,11 @@ ColumnLayout
anchors.centerIn: parent
Maui.ToolButton
ToolButton
{
anchors.centerIn: parent
iconName: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start"
iconColor: "white"
icon.name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start"
icon.color: "white"
onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play()
}
}
......@@ -82,7 +82,6 @@ ColumnLayout
spacing: space.large
// spacing: rowHeight
Column
{
Layout.fillWidth: true
......
......@@ -68,14 +68,6 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterSingletonType(componentUrl(QStringLiteral("Style.qml")), uri, 1, 0, "Style");
qmlRegisterType(componentUrl(QStringLiteral("ToolBar.qml")), uri, 1, 0, "ToolBar");
// #if QT_VERSION == QT_VERSION_CHECK(5, 12, 0)
#ifdef Q_OS_ANDROID
qmlRegisterType(componentUrl(QStringLiteral("ToolButton2.qml")), uri, 1, 0, "ToolButton");
#else
qmlRegisterType(componentUrl(QStringLiteral("ToolButton.qml")), uri, 1, 0, "ToolButton");
#endif
qmlRegisterType(componentUrl(QStringLiteral("ApplicationWindow.qml")), uri, 1, 0, "ApplicationWindow");
qmlRegisterType(componentUrl(QStringLiteral("Page.qml")), uri, 1, 0, "Page");
qmlRegisterType(componentUrl(QStringLiteral("ShareDialog.qml")), uri, 1, 0, "ShareDialog");
......@@ -90,7 +82,6 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterType(componentUrl(QStringLiteral("LabelDelegate.qml")), uri, 1, 0, "LabelDelegate");
qmlRegisterType(componentUrl(QStringLiteral("NewDialog.qml")), uri, 1, 0, "NewDialog");
qmlRegisterType(componentUrl(QStringLiteral("Dialog.qml")), uri, 1, 0, "Dialog");
// qmlRegisterType(componentUrl(QStringLiteral("Button.qml")), uri, 1, 0, "Button");
qmlRegisterType(componentUrl(QStringLiteral("AboutDialog.qml")), uri, 1, 0, "AboutDialog");
qmlRegisterType(componentUrl(QStringLiteral("Popup.qml")), uri, 1, 0, "Popup");
qmlRegisterType(componentUrl(QStringLiteral("TextField.qml")), uri, 1, 0, "TextField");
......@@ -99,13 +90,9 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterType(componentUrl(QStringLiteral("TagsDialog.qml")), uri, 1, 0, "TagsDialog");
qmlRegisterType(componentUrl(QStringLiteral("Badge.qml")), uri, 1, 0, "Badge");
qmlRegisterType(componentUrl(QStringLiteral("GridView.qml")), uri, 1, 0, "GridView");
// qmlRegisterType(componentUrl(QStringLiteral("Item.qml")), uri, 1, 0, "Item");
// qmlRegisterType(componentUrl(QStringLiteral("Menu.qml")), uri, 1, 0, "Menu");
// qmlRegisterType(componentUrl(QStringLiteral("MenuItem.qml")), uri, 1, 0, "MenuItem");
qmlRegisterType(componentUrl(QStringLiteral("ColorsBar.qml")), uri, 1, 0, "ColorsBar");
qmlRegisterType(componentUrl(QStringLiteral("ComboBox.qml")), uri, 1, 0, "ComboBox");
qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
// qmlRegisterType(componentUrl(QStringLiteral("ActionBar.qml")), uri, 1, 0, "ActionBar");
qmlRegisterType(componentUrl(QStringLiteral("private/TagList.qml")), uri, 1, 0, "TagList");
/** STORE CONTROLS **/
......
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