Commit ff623e17 authored by camilo higuita's avatar camilo higuita

Merge branch 'dev-win32' of https://anongit.kde.org/mauikit into dev-win32

parents 662e68e5 f8e42360
......@@ -60,16 +60,19 @@ if(${COMPONENT_EDITOR})
set(editor_SRCS
utils/editor/documenthandler.cpp
utils/editor/syntaxhighlighterutil.cpp
utils/editor/kquicksyntaxhighlighter/kquicksyntaxhighlighter.cpp
)
set(editor_HDRS
utils/editor/documenthandler.h
utils/editor/syntaxhighlighterutil.h
utils/editor/kquicksyntaxhighlighter/kquicksyntaxhighlighter.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/utils/editor
${CMAKE_CURRENT_BINARY_DIR}/utils/editor
${CMAKE_CURRENT_BINARY_DIR}/utils/editor/kquicksyntaxhighlighter
)
add_compile_definitions(COMPONENT_EDITOR)
endif()
......
......@@ -28,168 +28,170 @@ import org.kde.mauikit 1.0 as Maui
Maui.Dialog
{
id: control
defaultButtons: false
widthHint: 0.9
heightHint: 0.8
maxWidth: Maui.Style.unit * 400
maxHeight: Maui.Style.unit * 250
page.padding: Maui.Style.space.small
footBar.middleContent: ToolButton
{
icon.name: "link"
onClicked: Qt.openUrlExternally(Maui.App.webPage)
}
footBar.rightContent: ToolButton
{
icon.name: "love"
onClicked: Qt.openUrlExternally(Maui.App.donationPage)
}
footBar.leftContent: ToolButton
{
icon.name: "documentinfo"
onClicked: Qt.openUrlExternally(Maui.App.reportPage)
}
RowLayout
{
id: layout
anchors.centerIn: parent
width: parent.width
height: parent.height * 0.7
spacing: Maui.Style.space.big
// Behavior on width
// {
// NumberAnimation
// {
// duration: Kirigami.Units.longDuration
// easing.type: Easing.InOutQuad
// }
// }
Item
{
visible: parent.width > control.maxWidth * 0.7
Layout.fillHeight: true
Layout.margins: Maui.Style.space.small
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: visible ? Maui.Style.iconSizes.huge : 0
Image
{
id: _imgIcon
anchors.centerIn: parent
source: Maui.App.iconName
width: Math.max(Maui.Style.iconSizes.huge, parent.width)
height: width
sourceSize.width: width
sourceSize.height: height
asynchronous: true
fillMode: Image.PreserveAspectFit
}
DropShadow
{
anchors.fill: _imgIcon
horizontalOffset: 0
verticalOffset: 0
radius: 8.0
samples: 17
color: "#80000000"
source: _imgIcon
}
}
Kirigami.ScrollablePage
{
id: _descriptionItem
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Kirigami.Theme.backgroundColor: "transparent"
padding: 0
leftPadding: padding
rightPadding: padding
topPadding: padding
bottomPadding: padding
ColumnLayout
{
id: _columnInfo
spacing: Maui.Style.space.medium
Label
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
color: Kirigami.Theme.textColor
text: Maui.App.name
font.weight: Font.Bold
font.bold: true
font.pointSize: Maui.Style.fontSizes.huge
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
Label
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
color: Qt.lighter(Kirigami.Theme.textColor, 1.2)
text: Maui.App.version
font.weight: Font.Light
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Label
{
id: body
Layout.fillWidth: true
text: Maui.App.description
color: Kirigami.Theme.textColor
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Label
{
color: Kirigami.Theme.textColor
Layout.fillWidth: true
text: qsTr("By ") + Maui.App.org
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Kirigami.Separator
{
Layout.fillWidth: true
Layout.margins: Maui.Style.space.tiny
opacity: 0.4
}
Label
{
color: Kirigami.Theme.textColor
Layout.fillWidth: true
text: qsTr("Powered by") + " MauiKit " + Maui.App.mauikitVersion + " and Kirigami."
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
}
}
}
id: control
defaultButtons: false
widthHint: 0.9
heightHint: 0.8
maxWidth: Maui.Style.unit * 400
maxHeight: Maui.Style.unit * 250
page.padding: Maui.Style.space.small
footBar.middleContent: ToolButton
{
icon.name: "link"
onClicked: Qt.openUrlExternally(Maui.App.webPage)
}
footBar.rightContent: ToolButton
{
icon.name: "love"
onClicked: Qt.openUrlExternally(Maui.App.donationPage)
}
footBar.leftContent: ToolButton
{
icon.name: "documentinfo"
onClicked: Qt.openUrlExternally(Maui.App.reportPage)
}
RowLayout
{
id: layout
anchors.centerIn: parent
width: parent.width
height: parent.height * 0.7
spacing: Maui.Style.space.big
// Behavior on width
// {
// NumberAnimation
// {
// duration: Kirigami.Units.longDuration
// easing.type: Easing.InOutQuad
// }
// }
Item
{
visible: parent.width > control.maxWidth * 0.7
Layout.fillHeight: true
Layout.margins: Maui.Style.space.small
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: visible ? Maui.Style.iconSizes.huge : 0
Image
{
id: _imgIcon
anchors.centerIn: parent
source: Maui.App.iconName
width: Math.max(Maui.Style.iconSizes.huge, parent.width)
height: width
sourceSize.width: width
sourceSize.height: height
asynchronous: true
fillMode: Image.PreserveAspectFit
}
DropShadow
{
anchors.fill: _imgIcon
horizontalOffset: 0
verticalOffset: 0
radius: 8.0
samples: 17
color: "#80000000"
source: _imgIcon
}
}
Kirigami.ScrollablePage
{
id: _descriptionItem
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Kirigami.Theme.backgroundColor: "transparent"
padding: 0
leftPadding: padding
rightPadding: padding
topPadding: padding
bottomPadding: padding
ColumnLayout
{
id: _columnInfo
spacing: Maui.Style.space.medium
Label
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
color: Kirigami.Theme.textColor
text: Maui.App.name
font.weight: Font.Bold
font.bold: true
font.pointSize: Maui.Style.fontSizes.huge
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
Label
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
color: Qt.lighter(Kirigami.Theme.textColor, 1.2)
text: Maui.App.version
font.weight: Font.Light
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Label
{
id: body
Layout.fillWidth: true
text: Maui.App.description
color: Kirigami.Theme.textColor
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Label
{
color: Kirigami.Theme.textColor
Layout.fillWidth: true
text: qsTr("By ") + Maui.App.org
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
Kirigami.Separator
{
Layout.fillWidth: true
Layout.margins: Maui.Style.space.tiny
opacity: 0.4
}
Label
{
color: Kirigami.Theme.textColor
Layout.fillWidth: true
text: qsTr("Powered by") + " MauiKit " +
Maui.App.mauikitVersion + " and Kirigami."
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
}
}
}
}
......@@ -31,6 +31,7 @@ Item
property list<Action> hiddenActions
property int currentIndex : 0
property bool strech: Kirigami.Settings.isMobile
readonly property int count : control.actions.length + control.hiddenActions.length
signal clicked(int index)
......@@ -41,6 +42,7 @@ Item
{
id: _delegate
anchors.verticalCenter: parent.verticalCenter
Layout.fillWidth: control.strech
action: modelData
icon.width: Maui.Style.iconSizes.medium
icon.height: Maui.Style.iconSizes.medium
......@@ -70,7 +72,8 @@ Item
}
implicitHeight: parent.height
implicitWidth: _layout.implicitWidth
implicitWidth: strech ? parent.width : _layout.implicitWidth
Behavior on implicitWidth
{
......@@ -81,10 +84,11 @@ Item
}
}
Row
RowLayout
{
id: _layout
height: parent.height
width: control.strech ? parent.width : undefined
// width: Math.min(implicitWidth, parent.width)
spacing: Maui.Style.space.medium
clip: true
......@@ -92,13 +96,15 @@ Item
Repeater
{
model: control.actions
delegate: control.delegate
delegate: control.delegate
}
ToolButton
{
id: _exposedHiddenActionButton
visible: action
Layout.fillWidth: control.strech
action: control.currentIndex >= control.actions.length && control.currentIndex < control.count? control.hiddenActions[control.currentIndex - control.actions.length] : null
checkable: true
checked: visible
......@@ -121,6 +127,7 @@ Item
{
id: _menuButton
icon.name: "list-add"
visible: control.hiddenActions.length > 0
onClicked:
{
......
......@@ -143,6 +143,115 @@ Kirigami.AbstractApplicationWindow
* color: bgColor
}
*/
Component
{
id: _accountsComponent
Column
{
// height: Math.max( 300, implicitHeight +
// _accountsListing.contentHeight)
spacing: Maui.Style.space.medium
Kirigami.Icon
{
source: "user-identity"
height: Maui.Style.iconSizes.huge
width: height
anchors.horizontalCenter: parent.horizontalCenter
}
Label
{
text: currentAccount.user
width: parent.width
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideMiddle
wrapMode: Text.NoWrap
font.bold: true
font.weight: Font.Bold
}
Kirigami.Separator
{
width: parent.width
}
ListBrowser
{
id: _accountsListing
width: parent.width
listView.spacing: Maui.Style.space.medium
height: Math.min(listView.contentHeight, 300)
Kirigami.Theme.backgroundColor: "transparent"
model: Maui.BaseModel
{
list: Maui.App.accounts
}
delegate: Maui.ListBrowserDelegate
{
iconSource: "amarok_artist"
iconSizeHint: Maui.Style.iconSizes.medium
label1.text: model.user
label2.text: model.server
width: _accountsListing.width
height: Maui.Style.rowHeight * 1.2
leftPadding: Maui.Style.space.tiny
rightPadding: Maui.Style.space.tiny
onClicked:
{
_accountsListing.currentIndex = index
Maui.App.accounts.currentAccountIndex =
index
}
}
Component.onCompleted:
{
if(_accountsListing.count > 0)
{
_accountsListing.currentIndex = 0
Maui.App.accounts.currentAccountIndex =
_accountsListing.currentIndex
}
}
}
Kirigami.Separator
{
width: parent.width
}
Button
{
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Manage accounts")
visible: Maui.App.handleAccounts
icon.name: "list-add-user"
onClicked:
{
if(root.accounts)
accounts.open()
mainMenu.close()
}
}
Kirigami.Separator
{
width: parent.width
}
}
}
property Maui.ToolBar mheadBar : Maui.ToolBar
{
......@@ -165,7 +274,6 @@ Kirigami.AbstractApplicationWindow
checked: mainMenu.visible
onClicked:
{
menuButtonClicked()
mainMenu.visible ? mainMenu.close() : mainMenu.popup(parent, parent.x , parent.height+ Maui.Style.space.medium)
}
......@@ -175,56 +283,18 @@ Kirigami.AbstractApplicationWindow
id: mainMenu
modal: true
z: 999
width: Maui.Style.unit * 200
MenuItem
width: Maui.Style.unit * 250
Loader
{
visible: (_accountCombobox.count > 0) && Maui.App.handleAccounts
height: visible ? _accountCombobox.implicitHeight + Maui.Style.space.big : 0
ComboBox
{
id: _accountCombobox
anchors.fill: parent
anchors.margins: Maui.Style.space.small
popup.z: 999
width: parent.width
textRole: "user"
flat: true
model: Maui.BaseModel
{
list: Maui.App.accounts
}
onActivated: Maui.App.accounts.currentAccountIndex = index;
Component.onCompleted:
{
if(_accountCombobox.count > 0)
{
_accountCombobox.currentIndex = 0
Maui.App.accounts.currentAccountIndex = _accountCombobox.currentIndex
}
}
}
id: _accountsMenuLoader
width: parent.width * 0.9
anchors.horizontalCenter: parent.horizontalCenter
active: Maui.App.handleAccounts
sourceComponent: Maui.App.handleAccounts ?
_accountsComponent : null
}
MenuItem
{
text: qsTr("Accounts")
visible: Maui.App.handleAccounts
icon.name: "list-add-user"
onTriggered:
{
if(root.accounts)
accounts.open()
}
}
MenuSeparator
{
visible: _accountCombobox.visible
}
MenuItem
{
text: qsTr("About")
......
......@@ -26,7 +26,8 @@ import org.kde.kirigami 2.7 as Kirigami
Maui.GridView
{
id: control
Kirigami.Theme.colorSet: Kirigami.Theme.View
itemSize : Maui.Style.iconSizes.large * 2
property bool showEmblem : true
property bool keepEmblemOverlay : false
......
......@@ -59,7 +59,7 @@ Kirigami.ScrollablePage
spacing: Maui.Style.space.medium
Kirigami.Theme.backgroundColor: "transparent"
Kirigami.Theme.colorSet: Kirigami.Theme.View
padding: 0
leftPadding: control.ScrollBar.visible ? padding : control.ScrollBar.width
rightPadding: padding
......
......@@ -38,20 +38,20 @@ Kirigami.ScrollablePage
property bool showPreviewThumbnails: true
property alias model : _listView.model
property alias delegate : _listView.delegate
property alias section : _listView.section
property alias contentY: _listView.contentY
property alias currentIndex : _listView.currentIndex
property alias currentItem : _listView.currentItem
property alias count : _listView.count
property alias cacheBuffer : _listView.cacheBuffer
property alias delegate : _listView.delegate
property alias section : _listView.section
property alias contentY: _listView.contentY
property alias currentIndex : _listView.currentIndex
property alias currentItem : _listView.currentItem
property alias count : _listView.count
property alias cacheBuffer : _listView.cacheBuffer
property alias topMargin: _listView.topMargin
property alias bottomMargin: _listView.bottomMargin
property alias rightMargin: _listView.rightMargin
property alias leftMarging: _listView.leftMargin
property alias listView: _listView
property alias holder : _holder
property alias holder : _holder
signal itemClicked(int index)
signal itemDoubleClicked(int index)
......@@ -62,30 +62,30 @@ Kirigami.ScrollablePage
signal areaClicked(var mouse)
signal areaRightClicked()
signal keyPress(var event)
spacing: 0
focus: true
Kirigami.Theme.backgroundColor: "transparent"
padding: 0
leftPadding: padding
rightPadding: padding
topPadding: padding
bottomPadding: padding
Keys.enabled: false
ListView
signal keyPress(var event)
spacing: 0
focus: true
padding: 0
leftPadding: padding
rightPadding: padding
topPadding: padding
bottomPadding: padding
Keys.enabled: false
Kirigami.Theme.colorSet: Kirigami.Theme.View
ListView
{
id: _listView
id: _listView
focus: true
clip: true
spacing: Maui.Style.space.tiny
snapMode: ListView.NoSnap
boundsBehavior: !Kirigami.Settings.isMobile? Flickable.StopAtBounds : Flickable.OvershootBounds
boundsBehavior: !Kirigami.Settings.isMobile? Flickable.StopAtBounds :
Flickable.OvershootBounds
interactive: Kirigami.Settings.isMobile
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
......@@ -93,12 +93,12 @@ Kirigami.ScrollablePage
keyNavigationEnabled : bool
keyNavigationWraps : bool
Keys.onPressed: control.keyPress(event)
Maui.Holder
{
id: _holder
anchors.fill : parent