Commit cbb22e11 authored by Camilo Higuita's avatar Camilo Higuita

make wider use of Maui for the templated controls

parent 0754f2d1
......@@ -28,99 +28,11 @@ Maui.ApplicationWindow
pageStack.interactive: isMobile
pageStack.separatorVisible: pageStack.wideMode
readonly property bool isMobile : Kirigami.Settings.isMobile
readonly property bool isAndroid : inx.isAndroid()
property string backgroundColor: Kirigami.Theme.backgroundColor
property string textColor: Kirigami.Theme.textColor
property string highlightColor: Kirigami.Theme.highlightColor
property string highlightedTextColor: Kirigami.Theme.highlightedTextColor
property string buttonBackgroundColor: Kirigami.Theme.buttonBackgroundColor
property string viewBackgroundColor: Kirigami.Theme.viewBackgroundColor
property string altColor: Kirigami.Theme.complementaryBackgroundColor
property string altColorText: Kirigami.Theme.complementaryTextColor
/* FOR MATERIAL*/
Material.theme: Material.Light
Material.accent: highlightColor
Material.background: viewBackgroundColor
Material.primary: backgroundColor
Material.foreground: textColor
/***************************************************/
/******************** UI UNITS ********************/
/*************************************************/
property int iconSize : iconSizes.medium
readonly property int rowHeight: (defaultFontSize*2) + (isMobile ? space.large : space.big)
readonly property real factor : Kirigami.Units.gridUnit * (isMobile ? 0.2 : 0.2)
readonly property int contentMargins: space.medium
readonly property int defaultFontSize: Kirigami.Theme.defaultFont.pointSize
readonly property var fontSizes: ({
tiny: defaultFontSize * 0.7,
small: (isMobile ? defaultFontSize * 0.7 :
defaultFontSize * 0.8),
medium: (isMobile ? defaultFontSize * 0.8 :
defaultFontSize * 0.9),
default: (isMobile ? defaultFontSize * 0.9 :
defaultFontSize),
big: (isMobile ? defaultFontSize :
defaultFontSize * 1.1),
large: (isMobile ? defaultFontSize * 1.1 :
defaultFontSize * 1.2)
})
readonly property var space : ({
tiny: Kirigami.Units.smallSpacing,
small: Kirigami.Units.smallSpacing*2,
medium: Kirigami.Units.largeSpacing,
big: Kirigami.Units.largeSpacing*2,
large: Kirigami.Units.largeSpacing*3,
huge: Kirigami.Units.largeSpacing*4,
enormus: Kirigami.Units.largeSpacing*5
})
readonly property var iconSizes : ({
tiny : Kirigami.Units.iconSizes.small*0.5,
small : (isMobile ? Kirigami.Units.iconSizes.small*0.5:
Kirigami.Units.iconSizes.small),
medium : (isMobile ? (isAndroid ? 22 : Kirigami.Units.iconSizes.small) :
Kirigami.Units.iconSizes.smallMedium),
big: (isMobile ? Kirigami.Units.iconSizes.smallMedium :
Kirigami.Units.iconSizes.medium),
large: (isMobile ? Kirigami.Units.iconSizes.medium :
Kirigami.Units.iconSizes.large),
huge: (isMobile ? Kirigami.Units.iconSizes.large :
Kirigami.Units.iconSizes.huge),
enormous: (isMobile ? Kirigami.Units.iconSizes.huge :
Kirigami.Units.iconSizes.enormous)
})
/***************************************************/
/**************************************************/
/*************************************************/
headBar.middleContent: PathBar
{
id: pathBar
height: iconSizes.big
width: parent.width
width: headBar.width * (isMobile ? 0.6 : 0.7)
}
PlacesSidebar
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>widgets_templates/IndexPage.qml</file>
<file>widgets_templates/IndexListDelegate.qml</file>
<file>widgets_templates/IndexList.qml</file>
<file>widgets_templates/IndexIconDelegate.qml</file>
<file>widgets_templates/IndexGrid.qml</file>
<file>widgets_templates/IndexButton.qml</file>
<file>widgets/sidebar/SidebarDelegate.qml</file>
<file>widgets/sidebar/PlacesSidebar.qml</file>
<file>widgets_templates/IndexDelegate.qml</file>
......
......@@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
import "../../widgets_templates"
ItemDelegate
......@@ -34,7 +34,7 @@ ItemDelegate
Layout.fillHeight: true
width: parent.height
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
iconName: model.icon? model.icon : ""
......
......@@ -204,7 +204,7 @@ Maui.Page
Layout.maximumHeight: parent.height *0.5
anchors.bottom: parent.bottom
anchors.top: handle.bottom
source: !isMobile ? "../terminal/Terminal.qml" : undefined
source: !isMobile ? "../terminal/Terminal.qml" : ""
}
}
......
......@@ -11,14 +11,12 @@ Maui.ToolBar
{
id: viewBtn
iconName: browser.detailsView ? "view-list-icons" : "view-list-details"
iconColor: highlightColor
onClicked: browser.switchView()
}
middleContent: Row
{
anchors.centerIn: parent
spacing: space.medium
Maui.ToolButton
{
......@@ -26,7 +24,6 @@ Maui.ToolBar
onClicked: browser.goBack()
}
Maui.ToolButton
{
id: favIcon
......
......@@ -2,7 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import "../../widgets_templates"
import org.kde.maui 1.0 as Maui
import "Previewer"
Drawer
......@@ -11,7 +11,7 @@ Drawer
edge: Qt.RightEdge
width: Kirigami.Units.gridUnit * 17
height: browserContainer.height
y: headerBar.height + headBar.height
y: isMobile ?browser.headBar.height: browser.headBar.height + headBar.height
// visible: opened ? pageStack.currentIndex = 1 && pageStack.wideMode : false
clip: true
property string currentUrl: ""
......@@ -122,7 +122,7 @@ Drawer
Layout.fillWidth: true
Layout.fillHeight: true
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
......@@ -142,7 +142,7 @@ Drawer
Layout.fillWidth: true
Layout.fillHeight: true
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
......@@ -157,7 +157,7 @@ Drawer
Layout.fillWidth: true
Layout.fillHeight: true
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
......@@ -178,7 +178,7 @@ Drawer
Layout.fillWidth: true
Layout.fillHeight: true
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
......
......@@ -2,8 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import "../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
Rectangle
......@@ -48,11 +47,10 @@ Item
Layout.rightMargin: space.small
width: iconSize
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
iconName: "go-next"
isMask: true
onClicked:
{
browser.openFolder(entry.text)
......@@ -75,11 +73,10 @@ Item
Layout.rightMargin: space.small
width: iconSize
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
iconName: "go-home"
isMask: true
onClicked:
{
if(pageStack.currentIndex !== 0 && !pageStack.wideMode)
......@@ -134,11 +131,9 @@ Item
Layout.leftMargin: space.small
Layout.rightMargin: space.small
width: iconSize
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
iconName: "filename-space-amarok"
onClicked: showEntryBar()
}
......
......@@ -2,8 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtMultimedia 5.8
import "../../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
property alias player: player
......@@ -28,9 +27,10 @@ Item
height: parent.width * 0.3
Layout.margins: contentMargins
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: false
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
......@@ -18,9 +18,10 @@ Item
height: parent.width *0.3
Layout.margins: contentMargins
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: false
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
......
......@@ -2,8 +2,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtMultimedia 5.8
import "../../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
property alias player: player
......@@ -18,9 +17,10 @@ Item
height: parent.width * 0.5
Layout.margins: contentMargins
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: false
flat: true
size: iconSizes.huge
iconName: iteminfo.icon
......
......@@ -3,6 +3,7 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import "../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
......@@ -52,10 +53,9 @@ Item
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.left
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
iconName: "window-close"
iconColor: "white"
size: iconSizes.small
......@@ -110,10 +110,9 @@ Item
Layout.fillHeight: true
Layout.maximumWidth: iconSizes.medium
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
isMask: true
iconName: "overflow-menu"
iconColor: "white"
onClicked: itemMenu.showMultiple()
......
import QtQuick 2.9
import QtQuick.Controls 2.2
ToolButton
{
id: babeButton
property bool isMask : false
property string iconName
property int size : iconSizes.medium
property color iconColor: textColor
readonly property string defaultColor : textColor
property bool anim : false
icon.name: iconName
icon.width: size
icon.height: size
icon.color: !isMask ? "transparent" : (down ? highlightColor : (iconColor || defaultColor))
onClicked: if(anim) animIcon.running = true
flat: true
highlighted: false
SequentialAnimation
{
id: animIcon
PropertyAnimation
{
target: babeButton
property: "color"
easing.type: Easing.InOutQuad
from: highlightColor
to: iconColor
duration: 500
}
}
}
......@@ -2,6 +2,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
import org.kde.maui 1.0 as Maui
ItemDelegate
{
......@@ -43,11 +44,10 @@ ItemDelegate
}
}
IndexButton
Maui.ToolButton
{
id: emblem
isMask: false
iconName: (keepEmblemOverlay && emblemAdded) ? "emblem-remove" : "emblem-added"
visible: isHovered || (keepEmblemOverlay && emblemAdded)
z: 999
......@@ -79,7 +79,7 @@ ItemDelegate
Layout.alignment: Qt.AlignCenter
Layout.leftMargin: isDetails ? space.medium : 0
IndexButton
Maui.ToolButton
{
anchors.centerIn: parent
iconName: model.icon
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
Page
{
property int pageMargins : contentMargins
property bool headerbarVisible : true
property bool headerbarExit : true
property string headerbarExitIcon : "dialog-close"
property string headerbarTitle: ""
property alias headerBar: headerBar
property alias headerBarRight : headerbarActionsRight.children
property alias headerBarLeft : headerbarActionsLeft.children
signal exit();
clip: true
padding: 0
header: ToolBar
{
id: headerBar
height: implicitHeight
visible: headerbarVisible
position: ToolBar.Header
RowLayout
{
id: headerbarLayout
anchors.fill: parent
IndexButton
{
id: exitBtn
Layout.alignment : Qt.AlignLeft
visible: headerbarExit
anim : true
iconName : headerbarExitIcon
onClicked : exit()
}
Row
{
id: headerbarActionsLeft
Layout.alignment : Qt.AlignLeft
spacing: space.small
}
Label
{
text : headerbarTitle || ""
Layout.fillHeight : true
Layout.fillWidth : true
Layout.alignment : Qt.AlignCenter
elide : Text.ElideRight
font.bold : false
color : textColor
font.pointSize: fontSizes.big
horizontalAlignment : Text.AlignHCenter
verticalAlignment : Text.AlignVCenter
}
Row
{
id: headerbarActionsRight
spacing: space.small
Layout.alignment : Qt.AlignRight
}
}
}
}
/home/camilo/Coding/qml/buho/mauikit
\ No newline at end of file
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