diff --git a/src/shells/desktop/qml/AppChooser.qml b/src/shells/desktop/qml/AppChooser.qml index 1858863c..4710d1a9 100644 --- a/src/shells/desktop/qml/AppChooser.qml +++ b/src/shells/desktop/qml/AppChooser.qml @@ -29,10 +29,7 @@ import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import GreenIsland 1.0 import DesktopShell 0.1 -import FluidCore 1.0 as FluidCore -import FluidUi 1.0 as FluidUi -//Dialog { ShellWindow { id: appChooserWindow color: "transparent" @@ -42,29 +39,32 @@ ShellWindow { Component { id: itemDelegate - FluidUi.ListItem { + Item { id: wrapper - checked: ListView.isCurrentItem - enabled: true + //checked: ListView.isCurrentItem + //enabled: true + width: ListView.width + height: label.paintedHeight Label { - text: label + id: label + anchors.fill: parent + text: model.label font.weight: Font.Bold } } } - FluidCore.FrameSvgItem { + Rectangle { anchors.fill: parent - imagePath: "dialogs/background" + radius: 6 + border.color: "#999" + color: "#f1f1f1" ColumnLayout { anchors { fill: parent - leftMargin: parent.margins.left - topMargin: parent.margins.top - rightMargin: parent.margins.right - bottomMargin: parent.margins.bottom + margins: 4 } TextField { @@ -81,7 +81,9 @@ ShellWindow { orientation: ListView.Vertical model: AppChooserCategoriesModel {} delegate: itemDelegate - highlight: FluidUi.Highlight {} + highlight: Rectangle { + color: "lightsteelblue" + } highlightRangeMode: ListView.StrictlyEnforceRange Connections { @@ -99,8 +101,8 @@ ShellWindow { GridView { id: grid cacheBuffer: 1000 - cellWidth: theme.enormousIconSize - cellHeight: theme.enormousIconSize + cellWidth: 108 + cellHeight: 108 model: VisualDataModel { id: visualModel diff --git a/src/shells/desktop/qml/AppChooserDelegate.qml b/src/shells/desktop/qml/AppChooserDelegate.qml index 8c38bcc7..57eaa102 100644 --- a/src/shells/desktop/qml/AppChooserDelegate.qml +++ b/src/shells/desktop/qml/AppChooserDelegate.qml @@ -24,7 +24,8 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 MouseArea { id: delegateRoot diff --git a/src/shells/desktop/qml/AppChooserItem.qml b/src/shells/desktop/qml/AppChooserItem.qml index dfe9df50..af17c8b9 100644 --- a/src/shells/desktop/qml/AppChooserItem.qml +++ b/src/shells/desktop/qml/AppChooserItem.qml @@ -24,32 +24,35 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 -import FluidCore 1.0 -import FluidUi 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Layouts 1.0 -Item { +ColumnLayout { property alias icon: icon.source property alias label: label.text Image { id: icon - anchors { - top: parent.top - horizontalCenter: parent.horizontalCenter + sourceSize { + width: 48 + height: 48 } - sourceSize: Qt.size(theme.largeIconSize, theme.largeIconSize) + width: 48 + height: 48 smooth: true + + Layout.alignment: Qt.AlignCenter } Label { id: label - anchors { - top: icon.bottom - horizontalCenter: icon.horizontalCenter - } + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignTop wrapMode: Text.Wrap - width: parent.width - horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + + Layout.fillWidth: true + Layout.fillHeight: true } } diff --git a/src/shells/desktop/qml/Background.qml b/src/shells/desktop/qml/Background.qml index 0ef4bccf..b03ed2af 100644 --- a/src/shells/desktop/qml/Background.qml +++ b/src/shells/desktop/qml/Background.qml @@ -26,12 +26,12 @@ import QtQuick 2.0 import QtQuick.Window 2.0 -import FluidCore 1.0 +import FluidCore 1.0 as FluidCore Window { color: "black" - Settings { + FluidCore.Settings { id: settings schema: "org.hawaii.desktop" group: "background" diff --git a/src/shells/desktop/qml/Launcher.qml b/src/shells/desktop/qml/Launcher.qml index 74cd0874..36de87d7 100644 --- a/src/shells/desktop/qml/Launcher.qml +++ b/src/shells/desktop/qml/Launcher.qml @@ -27,7 +27,7 @@ import QtQuick 2.0 import QtQuick.Window 2.0 import GreenIsland 1.0 -import FluidCore 1.0 +import FluidCore 1.0 as FluidCore Window { id: launcherContainer @@ -44,95 +44,76 @@ Window { property alias orientation: launcherView.orientation // Size - property int size: { - switch (alignment) { - case LauncherAlignment.Left: - return tileSize + frame.margins.right + (padding * 2); - case LauncherAlignment.Right: - return tileSize + frame.margins.left + (padding * 2); - default: - return tileSize + frame.margins.top + (padding * 2); - } - } + property int size: tileSize + (padding * 2) // Number of items property alias count: launcherView.count - Settings { + FluidCore.Settings { id: settings schema: "org.hawaii.greenisland" group: "launcher" onValueChanged: loadSettings() } - FrameSvgItem { - id: frame + Rectangle { anchors.fill: parent - enabledBorders: { - switch (alignment) { - case LauncherAlignment.Left: - return FrameSvgItem.RightBorder; - case LauncherAlignment.Right: - return FrameSvgItem.LeftBorder; - case LauncherAlignment.Bottom: - return FrameSvgItem.LeftBorder | FrameSvgItem.TopBorder | FrameSvgItem.RightBorder; - } - } - imagePath: "widgets/background" - } - - Item { - id: launcher - anchors.fill: frame + border.color: "#999" + color: "#f1f1f1" - LauncherView { - id: launcherView + Item { + id: launcher anchors.fill: parent - orientation: { - switch (alignment) { - case LauncherAlignment.Bottom: - return ListView.Horizontal; - default: - return ListView.Vertical; + + LauncherView { + id: launcherView + anchors.fill: parent + orientation: { + switch (alignment) { + case LauncherAlignment.Bottom: + return ListView.Horizontal; + default: + return ListView.Vertical; + } } } - } - - states: [ - State { - name: "left" - when: alignment === LauncherAlignment.Left - PropertyChanges { - target: launcherView - anchors.topMargin: frame.margins.top + padding - anchors.rightMargin: frame.margins.right + padding - anchors.bottomMargin: frame.margins.top + padding - } - }, - State { - name: "right" - when: alignment === LauncherAlignment.Right - - PropertyChanges { - target: launcherView - anchors.leftMargin: frame.margins.left + padding - anchors.topMargin: frame.margins.top + padding - anchors.bottomMargin: frame.margins.top + padding + states: [ + State { + name: "left" + when: alignment === LauncherAlignment.Left + + PropertyChanges { + target: launcherView + anchors.topMargin: padding + anchors.rightMargin: padding + anchors.bottomMargin: padding + } + }, + State { + name: "right" + when: alignment === LauncherAlignment.Right + + PropertyChanges { + target: launcherView + anchors.leftMargin: padding + anchors.topMargin: padding + anchors.bottomMargin: padding + } + }, + State { + name: "bottom" + when: alignment === LauncherAlignment.Bottom + + PropertyChanges { + target: launcherView + anchors.leftMargin: padding + anchors.topMargin: padding + anchors.rightMargin: padding + } } - }, - State { - name: "bottom" - when: alignment === LauncherAlignment.Bottom - - PropertyChanges { - target: launcherView - anchors.leftMargin: frame.margins.left + padding - anchors.topMargin: frame.margins.top + padding - anchors.rightMargin: frame.margins.right + padding - } - } - ] + ] + } } Component.onCompleted: loadSettings() diff --git a/src/shells/desktop/qml/LauncherView.qml b/src/shells/desktop/qml/LauncherView.qml index e0d1bc65..9e57382a 100644 --- a/src/shells/desktop/qml/LauncherView.qml +++ b/src/shells/desktop/qml/LauncherView.qml @@ -28,7 +28,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import GreenIsland 1.0 import FluidCore 1.0 as FluidCore -import FluidUi 1.0 as FluidUi LauncherDropItem { id: launcher @@ -142,6 +141,7 @@ LauncherDropItem { } } + /* FluidUi.BusyIndicator { id: busyIndicator anchors { @@ -151,6 +151,7 @@ LauncherDropItem { running: item.running && !item.active visible: item.running && !item.active } + */ Image { id: runningIndicator diff --git a/src/shells/desktop/qml/NetworkIndicator.qml b/src/shells/desktop/qml/NetworkIndicator.qml index d175998d..a7f29f41 100644 --- a/src/shells/desktop/qml/NetworkIndicator.qml +++ b/src/shells/desktop/qml/NetworkIndicator.qml @@ -25,7 +25,6 @@ ***************************************************************************/ import QtQuick 2.0 -import FluidUi 1.0 PanelIndicator { iconName: "network-offline-symbolic" @@ -34,19 +33,23 @@ PanelIndicator { content: [ PanelMenuItem { text: qsTr("Wired") + /* items: [ Switch { id: wiredSwitch } ] + */ }, PanelMenuItem { text: qsTr("Wireless") + /* items: [ Switch { id: wirelessSwitch } ] + */ }, PanelMenuItem { separator: true diff --git a/src/shells/desktop/qml/NotificationItem.qml b/src/shells/desktop/qml/NotificationItem.qml index b1949f6e..437f531f 100644 --- a/src/shells/desktop/qml/NotificationItem.qml +++ b/src/shells/desktop/qml/NotificationItem.qml @@ -24,18 +24,17 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import GreenIsland 1.0 import DesktopShell 0.1 -import FluidCore 1.0 -import FluidUi 1.0 -import FluidExtra 1.0 +import FluidExtra 1.0 as FluidExtra NotificationWindow { id: notification color: "transparent" - width: 240 + frame.margins.left + frame.margins.right + (padding * 2) - height: summaryText.paintedHeight + bodyText.paintedHeight + frame.margins.top + frame.margins.bottom + (padding * 3) + width: 240 + (padding * 2) + 2 + height: summaryText.paintedHeight + bodyText.paintedHeight + (padding * 3) + 2 property int identifier property string appName @@ -93,20 +92,12 @@ NotificationWindow { } */ - FrameSvgItem { + Rectangle { id: frame anchors.fill: parent - imagePath: "widgets/tooltip" - } - - Item { - anchors { - fill: frame - leftMargin: frame.margins.left - topMargin: frame.margins.top - rightMargin: frame.margins.right - bottomMargin: frame.margins.bottom - } + radius: 6 + border.color: "#999" + color: "white" Item { id: iconImage @@ -127,7 +118,7 @@ NotificationWindow { visible: icon.source !== "" } - ImageItem { + FluidExtra.ImageItem { id: image anchors.fill: parent smooth: true diff --git a/src/shells/desktop/qml/Panel.qml b/src/shells/desktop/qml/Panel.qml index bd377813..3f8faa97 100644 --- a/src/shells/desktop/qml/Panel.qml +++ b/src/shells/desktop/qml/Panel.qml @@ -24,8 +24,9 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 import QtQuick.Window 2.0 +import QtQuick.Controls 1.0 import FluidCore 1.0 Window { @@ -36,21 +37,27 @@ Window { property real padding: 2 // Panel height - property int realSize: theme.smallIconSize + (padding * 2) - property int size: realSize + frame.margins.bottom + property int realSize: 24 + (padding * 2) + property int size: realSize - FrameSvgItem { - id: frame + Rectangle { + id: contents anchors.fill: parent - enabledBorders: FrameSvgItem.BottomBorder - imagePath: "widgets/toolbar" - } + color: "#f1f1f1" + + PanelView { + anchors { + left: parent.left + top: parent.top + } + width: parent.width + height: parent.height - 1 + } - PanelView { - anchors { - fill: frame - verticalCenter: frame.verticalCenter - bottomMargin: frame.margins.bottom + Rectangle { + id: border + color: "#999" + height: 1 } } } diff --git a/src/shells/desktop/qml/PanelContainerMenuItem.qml b/src/shells/desktop/qml/PanelContainerMenuItem.qml index 74e46aa7..db11e411 100644 --- a/src/shells/desktop/qml/PanelContainerMenuItem.qml +++ b/src/shells/desktop/qml/PanelContainerMenuItem.qml @@ -24,9 +24,8 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 -import FluidCore 1.0 -import FluidUi 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 Item { id: contextMenuItem diff --git a/src/shells/desktop/qml/PanelIndicator.qml b/src/shells/desktop/qml/PanelIndicator.qml index 8b7adc73..2f9ac3b0 100644 --- a/src/shells/desktop/qml/PanelIndicator.qml +++ b/src/shells/desktop/qml/PanelIndicator.qml @@ -24,9 +24,8 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 -import FluidCore 1.0 -import FluidUi 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import "PanelMenuManager.js" as PanelMenuManager Item { @@ -40,7 +39,7 @@ Item { property PanelMenu menu // Icon size - property real iconSize: theme.smallIconSize + property real iconSize: 24 // Spacing between icon and label property real spacing: iconSize / 4 @@ -54,6 +53,10 @@ Item { width: iconItem.width + labelItem.paintedWidth + (spacing * 4) + SystemPalette { + id: palette + } + MouseArea { anchors.fill: parent hoverEnabled: true @@ -99,12 +102,10 @@ Item { } } - FrameSvgItem { + Rectangle { id: highlight anchors.fill: parent - imagePath: "widgets/menuitem" - prefix: hovered || selected ? "selected" : "" - opacity: hovered || selected ? 1.0 : 0.0 + color: selected || hovered ? palette.highlight : "transparent" Behavior on opacity { NumberAnimation { duration: 200 } @@ -114,10 +115,7 @@ Item { Item { anchors { fill: highlight - leftMargin: highlight.margins.left - topMargin: highlight.margins.top - rightMargin: highlight.margins.right - bottomMargin: highlight.margins.bottom + margins: 4 } Image { @@ -130,7 +128,10 @@ Item { rightMargin: spacing } source: "image://desktoptheme/" + (iconName ? iconName : "unknown") - sourceSize: Qt.size(iconSize, iconSize) + sourceSize { + width: iconSize + height: iconSize + } width: iconSize height: iconSize smooth: true @@ -151,7 +152,7 @@ Item { // TODO: Define a specific font in Fluid::Theme and use it here font.weight: Font.Bold font.pointSize: 9 - color: hovered || selected ? theme.highlightedTextColor : theme.windowTextColor + color: selected || hovered ? palette.highlightedTextColor : palette.text visible: label != "" } } diff --git a/src/shells/desktop/qml/PanelMenu.qml b/src/shells/desktop/qml/PanelMenu.qml index 9c76e560..30a0946d 100644 --- a/src/shells/desktop/qml/PanelMenu.qml +++ b/src/shells/desktop/qml/PanelMenu.qml @@ -24,76 +24,65 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import DesktopShell 0.1 -import FluidCore 1.0 -import FluidUi 1.0 ShellWindow { id: panelMenu color: "transparent" width: menu.width height: menu.height - visible: status != DialogStatus.Closed + visible: false default property alias content: menuContents.children - property int status: DialogStatus.Closed - FrameSvgItem { + Rectangle { id: menuContainer width: menu.width height: menu.height - imagePath: "widgets/toolbar" + radius: 6 + border.color: "#999" + color: "white" state: "hidden" - enabled: status == DialogStatus.Open + enabled: panelMenu.visible Item { id: contentItem - x: menuContainer.margins.left - y: menuContainer.margins.top width: Math.max(menuContents.width, theme.defaultFont.mSize.width * 12) height: Math.min(menuContents.height, theme.defaultFont.mSize.height * 25) - Flickable { - id: flickable - anchors.fill: parent - clip: true + ScrollView { + Flickable { + id: flickable + anchors.fill: parent - Column { - id: menuContents - spacing: 4 - onChildrenChanged: { - // Close the popup menu when a menu item is clicked - connectClickedSignal(); + Column { + id: menuContents + spacing: 4 + onChildrenChanged: { + // Close the popup menu when a menu item is clicked + connectClickedSignal(); - // Resize the popup menu accordingly to its items - resizePopupMenu(); - } - onChildrenRectChanged: resizePopupMenu() + // Resize the popup menu accordingly to its items + resizePopupMenu(); + } + onChildrenRectChanged: resizePopupMenu() - function connectClickedSignal() { - for (var i = 0; i < children.length; ++i) { - if (children[i].clicked != undefined) - children[i].clicked.connect(panelMenu.close); + function connectClickedSignal() { + for (var i = 0; i < children.length; ++i) { + if (children[i].clicked != undefined) + children[i].clicked.connect(panelMenu.close); + } } - } - function resizePopupMenu() { - panelMenu.width = childrenRect.width + menuContainer.margins.left + menuContainer.margins.right; - panelMenu.height = childrenRect.height + menuContainer.margins.top + menuContainer.margins.bottom; + function resizePopupMenu() { + panelMenu.width = childrenRect.width; + panelMenu.height = childrenRect.height; + } } } } - - ScrollBar { - id: scrollBar - flickableItem: flickable - visible: flickable.contentHeight > contentItem.height - anchors { - top: flickable.top - right: flickable.right - } - } } states: [ @@ -137,7 +126,7 @@ ShellWindow { easing.type: Easing.Linear } } - PropertyAction { target: panelMenu; property: "status"; value: DialogStatus.Closed } + PropertyAction { target: panelMenu; property: "visible"; value: false } } }, Transition { @@ -159,23 +148,17 @@ ShellWindow { easing.type: Easing.Linear } } - PropertyAction { target: panelMenu; property: "status"; value: DialogStatus.Open } + PropertyAction { target: panelMenu; property: "visible"; value: true } } } ] } function open() { - if (status == DialogStatus.Open || status == DialogStatus.Opening) - return; - - status = DialogStatus.Opening; + visible = true; } function close() { - if (status == DialogStatus.Closed) - return; - - status = DialogStatus.Closing; + visible = false; } } diff --git a/src/shells/desktop/qml/PanelMenuItem.qml b/src/shells/desktop/qml/PanelMenuItem.qml index 1c5d7c68..1e98b40b 100644 --- a/src/shells/desktop/qml/PanelMenuItem.qml +++ b/src/shells/desktop/qml/PanelMenuItem.qml @@ -24,9 +24,8 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 -import FluidCore 1.0 -import FluidUi 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import "PanelMenuManager.js" as PanelMenuManager Item { @@ -66,90 +65,89 @@ Item { property Item separatorItem } + SystemPalette { + id: palette + } + Component { id: separatorComponent - FrameSvgItem { + Rectangle { anchors { left: parent.left right: parent.right verticalCenter: parent.verticalCenter } - imagePath: "widgets/menuitem" - prefix: "separator" - height: margins.top + margins.bottom + height: 1 + color: "#999" } } - FrameSvgItem { + Rectangle { id: container anchors.fill: parent - imagePath: "widgets/menuitem" - prefix: "" - opacity: separator ? 0.0 : prefix == "" ? 0.0 : 1.0 + color: "transparent" + opacity: separator ? 0.0 : 1.0 Behavior on opacity { NumberAnimation { duration: 200 } } - } - - Item { - id: item - - anchors { - fill: container - leftMargin: container.margins.left + padding - topMargin: container.margins.top - rightMargin: container.margins.right + padding - bottomMargin: container.margins.bottom - } - Label { - id: label + Item { + id: item anchors { - left: parent.left - verticalCenter: parent.verticalCenter + fill: parent + leftMargin: padding + rightMargin: padding } - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - visible: !separator - } - Row { - id: contentsItem - anchors { - right: parent.right - verticalCenter: parent.verticalCenter + Label { + id: label + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + } + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + visible: !separator } - visible: children.length > 0 - onChildrenChanged: { - // Trigger the clicked() signal for child items too - for (var i = 0; i < children.length; ++i) { - if (children[i].clicked != undefined) - children[i].clicked.connect(menuItem.clicked) + + Row { + id: contentsItem + anchors { + right: parent.right + verticalCenter: parent.verticalCenter + } + visible: children.length > 0 + onChildrenChanged: { + // Trigger the clicked() signal for child items too + for (var i = 0; i < children.length; ++i) { + if (children[i].clicked != undefined) + children[i].clicked.connect(menuItem.clicked) + } } } } - } - MouseArea { - anchors.fill: item - hoverEnabled: true - preventStealing: true - onEntered: { - label.color = theme.highlightedTextColor; - container.prefix = "selected"; - } - onExited: { - label.color = theme.windowTextColor; - container.prefix = ""; - } - onClicked: { - PanelMenuManager.currentIndicator.selected = false; - PanelMenuManager.triggered = false; - PanelMenuManager.currentIndicator = null; - menuItem.clicked(); + MouseArea { + anchors.fill: item + hoverEnabled: true + preventStealing: true + onEntered: { + label.color = palette.highlightedText; + container.color = palette.highlight; + } + onExited: { + label.color = palette.text; + container.color = "transparent"; + } + onClicked: { + PanelMenuManager.currentIndicator.selected = false; + PanelMenuManager.triggered = false; + PanelMenuManager.currentIndicator = null; + menuItem.clicked(); + } } } } diff --git a/src/shells/desktop/qml/PanelView.qml b/src/shells/desktop/qml/PanelView.qml index 07b6b843..5169fd40 100644 --- a/src/shells/desktop/qml/PanelView.qml +++ b/src/shells/desktop/qml/PanelView.qml @@ -24,7 +24,8 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import GreenIsland 1.0 Item { diff --git a/src/shells/desktop/qml/UserIndicator.qml b/src/shells/desktop/qml/UserIndicator.qml index 79ae6816..6b0e1bb7 100644 --- a/src/shells/desktop/qml/UserIndicator.qml +++ b/src/shells/desktop/qml/UserIndicator.qml @@ -24,9 +24,9 @@ * $END_LICENSE$ ***************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 import GreenIsland 1.0 -import FluidUi 1.0 import QtAccountsService 5.0 PanelIndicator {