Skip to content

Commit

Permalink
Finish QtQuick Controls migration
Browse files Browse the repository at this point in the history
Migrate what's left.

Issue: #4
  • Loading branch information
plfiorini committed Jun 27, 2013
1 parent cef5547 commit 2b364ad
Show file tree
Hide file tree
Showing 15 changed files with 244 additions and 273 deletions.
34 changes: 18 additions & 16 deletions src/shells/desktop/qml/AppChooser.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand All @@ -81,7 +81,9 @@ ShellWindow {
orientation: ListView.Vertical
model: AppChooserCategoriesModel {}
delegate: itemDelegate
highlight: FluidUi.Highlight {}
highlight: Rectangle {
color: "lightsteelblue"
}
highlightRangeMode: ListView.StrictlyEnforceRange

Connections {
Expand All @@ -99,8 +101,8 @@ ShellWindow {
GridView {
id: grid
cacheBuffer: 1000
cellWidth: theme.enormousIconSize
cellHeight: theme.enormousIconSize
cellWidth: 108
cellHeight: 108
model: VisualDataModel {
id: visualModel

Expand Down
3 changes: 2 additions & 1 deletion src/shells/desktop/qml/AppChooserDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* $END_LICENSE$
***************************************************************************/

import QtQuick 2.0
import QtQuick 2.1
import QtQuick.Controls 1.0

MouseArea {
id: delegateRoot
Expand Down
31 changes: 17 additions & 14 deletions src/shells/desktop/qml/AppChooserItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions src/shells/desktop/qml/Background.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
127 changes: 54 additions & 73 deletions src/shells/desktop/qml/Launcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion src/shells/desktop/qml/LauncherView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -142,6 +141,7 @@ LauncherDropItem {
}
}

/*
FluidUi.BusyIndicator {
id: busyIndicator
anchors {
Expand All @@ -151,6 +151,7 @@ LauncherDropItem {
running: item.running && !item.active
visible: item.running && !item.active
}
*/

Image {
id: runningIndicator
Expand Down
5 changes: 4 additions & 1 deletion src/shells/desktop/qml/NetworkIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
***************************************************************************/

import QtQuick 2.0
import FluidUi 1.0

PanelIndicator {
iconName: "network-offline-symbolic"
Expand All @@ -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
Expand Down
Loading

0 comments on commit 2b364ad

Please sign in to comment.