Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WIP Share all default instances of Style objects
- API break
- Buttons in components example break
- Styles need audit to make sure they're not dependent on parent classes
- Errors in SelectionDialog/MultiSelectionDialog that make no sense
  • Loading branch information
special committed Oct 6, 2012
1 parent 22ed965 commit fa56314
Show file tree
Hide file tree
Showing 31 changed files with 84 additions and 48 deletions.
3 changes: 2 additions & 1 deletion src/meego/AbstractMenu.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Popup {
id: root
Expand All @@ -57,7 +58,7 @@ Popup {
*/

// platformStyle API
property Style platformStyle: MenuStyle{}
property QtObject platformStyle: StyleAPI.get("MenuStyle");
property alias style: root.platformStyle // Deprecated
property alias platformTitle: titleBar.children
property alias title: titleBar.children // Deprecated
Expand Down
3 changes: 2 additions & 1 deletion src/meego/BusyIndicator.qml
Expand Up @@ -43,6 +43,7 @@ import "." 1.0

import "UIConstants.js" as UI
import "Utils.js" as Utils
import "style.js" as StyleAPI

// ### Display Entered / Exited! Pause animation when not "on display".
// ### LayoutDirection
Expand All @@ -52,7 +53,7 @@ ImplicitSizeItem {

property bool running: false

property Style platformStyle: BusyIndicatorStyle{}
property QtObject platformStyle: StyleAPI.get("BusyIndicatorStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/Button.qml
Expand Up @@ -41,6 +41,7 @@
import QtQuick 1.1
import "." 1.0
import "UIConstants.js" as UI
import "style.js" as StyleAPI

ImplicitSizeItem {
id: button
Expand All @@ -59,7 +60,7 @@ ImplicitSizeItem {
property string __buttonType

// Styling for the Button
property Style platformStyle: ButtonStyle {}
property QtObject platformStyle: StyleAPI.get("ButtonStyle");

// Deprecated, TODO remove
property alias style: button.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/CheckBox.qml
Expand Up @@ -42,11 +42,12 @@ import QtQuick 1.1
import "." 1.0

import "UIConstants.js" as UI
import "style.js" as StyleAPI

ImplicitSizeItem {
id: checkbox

property Style platformStyle: CheckBoxStyle{}
property QtObject platformStyle: StyleAPI.get("CheckBoxStyle");
property alias platformMouseAnchors: mouseArea.anchors

//Deprecated, TODO Remove this on w13
Expand Down
3 changes: 2 additions & 1 deletion src/meego/CommonDialog.qml
Expand Up @@ -40,13 +40,14 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Dialog {
id: genericDialog

property string titleText: ""

property Style platformStyle: SelectionDialogStyle {}
property QtObject platformStyle: StyleAPI.get("SelectionDialogStyle");

//Deprecated, TODO Remove this on w13
property alias style: genericDialog.platformStyle
Expand Down
5 changes: 2 additions & 3 deletions src/meego/ContextMenu.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

AbstractMenu {
id: root
Expand All @@ -51,15 +52,13 @@ AbstractMenu {
property url icon

// platformStyle API
property Style platformStyle: ContextMenuStyle{}
property Style style: ContextMenuStyle{}
property QtObject platformStyle: StyleAPI.get("ContextMenuStyle");

onPlatformTitleTextChanged: logDeprecatedMsg("platformTitleText")
onTitleTextChanged: logDeprecatedMsg("titleText")
onPlatformIconChanged: logDeprecatedMsg("platformIcon")
onIconChanged: logDeprecatedMsg("iconChanged")
onPlatformStyleChanged: logDeprecatedMsg("platformStyle")
onStyleChanged: logDeprecatedMsg("style")

function logDeprecatedMsg(name) {
console.log("Warning: " + name + " is deprecated");
Expand Down
3 changes: 2 additions & 1 deletion src/meego/Dialog.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Popup {
id: root
Expand All @@ -53,7 +54,7 @@ Popup {
signal accepted
signal rejected

property Style platformStyle: DialogStyle {}
property QtObject platformStyle: StyleAPI.get("DialogStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/EditBubble.qml
Expand Up @@ -42,6 +42,7 @@ import QtQuick 1.1
import "." 1.0
import "Utils.js" as Utils
import "EditBubble.js" as Private
import "style.js" as StyleAPI

Item {
id: bubble
Expand All @@ -50,7 +51,7 @@ Item {

property alias privateRect: rect

property Style platformStyle: EditBubbleStyle {}
property QtObject platformStyle: StyleAPI.get("EditBubbleStyle");

property variant position: Qt.point(0,0)

Expand Down
3 changes: 2 additions & 1 deletion src/meego/EditBubbleButton.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

BorderImage {
id: button
Expand All @@ -49,7 +50,7 @@ BorderImage {
property bool selected: false
smooth: true

property Style platformStyle: EditBubbleButtonStyle {}
property QtObject platformStyle: StyleAPI.get("EditBubbleButtonStyle");

width: label.width + platformStyle.buttonPaddingLeft +
platformStyle.buttonPaddingRight +
Expand Down
4 changes: 2 additions & 2 deletions src/meego/Label.qml
Expand Up @@ -40,14 +40,14 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Text {
id: root

// Common public API
// Styling for the Label
property Style platformStyle: LabelStyle{}

property QtObject platformStyle: StyleAPI.get("LabelStyle");

font.family: platformStyle.fontFamily
font.pixelSize: platformStyle.fontPixelSize
Expand Down
14 changes: 5 additions & 9 deletions src/meego/MultiSelectionDialog.qml
Expand Up @@ -116,12 +116,6 @@ CommonDialog {
}
}

// Style API
property Style platformStyle: SelectionDialogStyle {}

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle

// private api
property int __pressDelay: platformStyle.pressDelay
property variant __selectedIndexesHash: []
Expand Down Expand Up @@ -180,10 +174,12 @@ CommonDialog {
ScrollDecorator {
id: scrollDecorator
flickableItem: selectionListView
platformStyle.inverted: true
platformStyle: ScrollDecoratorStyle {
inverted: true
}
}
onCountChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight
onModelChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight
onCountChanged: selectionContent.listViewHeight = selectionListView.count * root.platformStyle.itemHeight
onModelChanged: selectionContent.listViewHeight = selectionListView.count * root.platformStyle.itemHeight
}

}
Expand Down
3 changes: 2 additions & 1 deletion src/meego/PageStackWindow.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Window {
id: window
Expand All @@ -48,7 +49,7 @@ Window {
property bool showToolBar: true
property variant initialPage
property alias pageStack: contentArea
property Style platformStyle: PageStackWindowStyle{}
property QtObject platformStyle: StyleAPI.get("PageStackWindowStyle");
property alias platformToolBarHeight: toolBar.height // read-only

//Deprecated, TODO Remove this on w13
Expand Down
3 changes: 2 additions & 1 deletion src/meego/ProgressBar.qml
Expand Up @@ -42,6 +42,7 @@ import QtQuick 1.1
import "." 1.0
import Qt.labs.components 1.1

import "style.js" as StyleAPI
import "Utils.js" as Utils

ImplicitSizeItem {
Expand All @@ -53,7 +54,7 @@ ImplicitSizeItem {
property bool indeterminate: false

// Styling for the ProgressBar
property Style platformStyle: ProgressBarStyle{}
property QtObject platformStyle: StyleAPI.get("ProgressBarStyle");

//Deprecated, can be removed on W13
property alias style: container.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/QueryDialog.qml
Expand Up @@ -41,6 +41,7 @@
import QtQuick 1.1
import "." 1.0
import "UIConstants.js" as UI
import "style.js" as StyleAPI

Dialog {
id: root
Expand All @@ -67,7 +68,7 @@ Dialog {
//ToDo
property alias icon: iconImage.source

property Style platformStyle: QueryDialogStyle {}
property QtObject platformStyle: StyleAPI.get("QueryDialogStyle");

//__centerContentField: true

Expand Down
3 changes: 2 additions & 1 deletion src/meego/RadioButton.qml
Expand Up @@ -39,11 +39,12 @@
****************************************************************************/

import QtQuick 1.1
import "style.js" as StyleAPI

CheckBox {
id: radioButton

property Style platformStyle: RadioButtonStyle{}
property QtObject platformStyle: StyleAPI.get("RadioButtonStyle");
property alias style: radioButton.platformStyle

__imageSource: !radioButton.enabled ? platformStyle.backgroundDisabled :
Expand Down
3 changes: 2 additions & 1 deletion src/meego/ScrollDecorator.qml
Expand Up @@ -41,6 +41,7 @@
import QtQuick 1.1
import "." 1.0
import "UIConstants.js" as UI
import "style.js" as StyleAPI

/**
* Class: ScrollDecorator
Expand Down Expand Up @@ -68,7 +69,7 @@ Item {

property bool __alwaysShowIndicator: true

property Style platformStyle: ScrollDecoratorStyle{}
property QtObject platformStyle: StyleAPI.get("ScrollDecoratorStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/SectionScroller.qml
Expand Up @@ -40,6 +40,7 @@
import QtQuick 1.1
import "." 1.0
import "SectionScroller.js" as Sections
import "style.js" as StyleAPI

Item {
id: root
Expand All @@ -58,7 +59,7 @@ Item {
}
}

property Style platformStyle: SectionScrollerStyle {}
property QtObject platformStyle: StyleAPI.get("SectionScrollerStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/SectionScrollerLabel.qml
Expand Up @@ -39,6 +39,7 @@
****************************************************************************/

import QtQuick 1.1
import "style.js" as StyleAPI

Item {
id: root
Expand All @@ -50,7 +51,7 @@ Item {
width: wrapper.width
height: wrapper.height

property Style platformStyle: SectionScrollerStyle {}
property QtObject platformStyle: StyleAPI.get("SectionScrollerStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
10 changes: 3 additions & 7 deletions src/meego/SelectionDialog.qml
Expand Up @@ -127,12 +127,6 @@ CommonDialog {
}
}

// Style API
property Style platformStyle: SelectionDialogStyle {}

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle

// private api
property int __pressDelay: platformStyle.pressDelay

Expand Down Expand Up @@ -171,7 +165,9 @@ CommonDialog {
ScrollDecorator {
id: scrollDecorator
flickableItem: selectionListView
platformStyle.inverted: true
platformStyle: ScrollDecoratorStyle {
inverted: true
}
}
onCountChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight
onModelChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight
Expand Down
3 changes: 2 additions & 1 deletion src/meego/SelectionHandles.qml
Expand Up @@ -4,12 +4,13 @@ import "Utils.js" as Utils
import "EditBubble.js" as Popup
import "SelectionHandles.js" as Private
import "Magnifier.js" as MagnifierPopup
import "style.js" as StyleAPI

Item {
id: contents

// Styling for the Label
property Style platformStyle: SelectionHandlesStyle{}
property QtObject platformStyle: StyleAPI.get("SelectionHandlesStyle");

//Deprecated, TODO Remove this some day
property alias style: contents.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/Sheet.qml
Expand Up @@ -40,6 +40,7 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

MouseArea {
id: root
Expand All @@ -65,7 +66,7 @@ MouseArea {
signal accepted
signal rejected

property QtObject platformStyle: SheetStyle {}
property QtObject platformStyle: StyleAPI.get("SheetStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down
3 changes: 2 additions & 1 deletion src/meego/SheetButton.qml
Expand Up @@ -42,11 +42,12 @@

import QtQuick 1.1
import "." 1.0
import "style.js" as StyleAPI

Button {
id: root

property Style platformStyle: SheetButtonStyle {}
property QtObject platformStyle: StyleAPI.get("SheetButtonStyle");

//Deprecated, TODO Remove this on w13
property alias style: root.platformStyle
Expand Down

0 comments on commit fa56314

Please sign in to comment.