Skip to content

Commit

Permalink
@ryu-ketsueki Windows RT 8.1 Update 3 style fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Feb 7, 2019
1 parent 7f1259d commit ed802ed
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 195 deletions.
14 changes: 7 additions & 7 deletions package/contents/ui/AppletConfig.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Item {

//--- Sizes
readonly property int panelIconSize: 24 * units.devicePixelRatio
readonly property int flatButtonSize: 60 * units.devicePixelRatio
readonly property int flatButtonIconSize: 30 * units.devicePixelRatio
readonly property int sidebarWidth: flatButtonSize
readonly property int flatButtonSize: 32 * units.devicePixelRatio
readonly property int flatButtonIconSize: 0 * units.devicePixelRatio
readonly property int sidebarWidth: 0
readonly property int sidebarOpenWidth: 200 * units.devicePixelRatio
readonly property int sidebarRightMargin: 4 * units.devicePixelRatio
readonly property int appListWidth: plasmoid.configuration.appListWidth * units.devicePixelRatio

property bool showSearch: false
readonly property int appAreaWidth: (showSearch ? appListWidth : 0)
readonly property int leftSectionWidth: sidebarWidth + sidebarRightMargin + appAreaWidth
readonly property int leftSectionWidth: 0 + sidebarRightMargin + appAreaWidth

readonly property real tileScale: plasmoid.configuration.tileScale
readonly property int cellBoxUnits: 80
Expand Down Expand Up @@ -61,11 +61,11 @@ Item {

readonly property int searchFilterRowHeight: {
if (plasmoid.configuration.appListWidth >= 310) {
return flatButtonSize // 60px
return 30 // 60px
} else if (plasmoid.configuration.appListWidth >= 250) {
return flatButtonSize*3/4 // 45px
return 30 // 45px
} else {
return flatButtonSize/2 // 30px
return 30 // 30px
}
}

Expand Down
6 changes: 3 additions & 3 deletions package/contents/ui/FlatButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ PlasmaComponents.ToolButton {
PlasmaCore.IconItem {
id: icon
source: control.iconName || control.iconSource || control.icon
width: config.flatButtonIconSize
height: config.flatButtonIconSize
width: 30
height: 30
anchors.centerIn: parent
// colorGroup: PlasmaCore.Theme.ButtonColorGroup
}
Expand Down Expand Up @@ -153,4 +153,4 @@ PlasmaComponents.ToolButton {
]
}
}
}
}
6 changes: 1 addition & 5 deletions package/contents/ui/Popup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MouseArea {

RowLayout {
anchors.fill: parent
spacing: 0
spacing: 5

SearchView {
id: searchView
Expand Down Expand Up @@ -47,10 +47,6 @@ MouseArea {

}

SidebarView {
id: sidebarView
}

MouseArea {
visible: !plasmoid.configuration.tilesLocked && !(plasmoid.location == PlasmaCore.Types.TopEdge || plasmoid.location == PlasmaCore.Types.RightEdge)
anchors.top: parent.top
Expand Down
15 changes: 11 additions & 4 deletions package/contents/ui/SearchView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ Item {
// Behavior on implicitWidth {
// NumberAnimation { duration: 400 }
// }

SidebarView {
id: sidebarView
anchors.topMargin: parent.top
anchors.leftMargin: config.sidebarRightMargin
anchors.left: parent.left
}

Connections {
target: search
onIsSearchingChanged: {
Expand Down Expand Up @@ -84,7 +92,7 @@ Item {
when: !searchOnTop
PropertyChanges {
target: stackViewContainer
anchors.bottomMargin: searchField.height
anchors.bottomMargin: 7 + searchField.height
}
PropertyChanges {
target: searchField
Expand All @@ -97,6 +105,7 @@ Item {
Item {
id: stackViewContainer
anchors.fill: parent
anchors.rightMargin: parent.right

SearchResultsView {
id: searchResultsView
Expand Down Expand Up @@ -203,7 +212,6 @@ Item {
active: false
// asynchronous: true
function open(tile) {
config.showSearch = true
active = true
item.open(tile)
}
Expand All @@ -212,11 +220,11 @@ Item {
SearchStackView {
id: stackView
width: config.appAreaWidth
anchors.topMargin: sidebarView.y + 40
anchors.top: parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom
initialItem: appsView

visible: opacity > 0
opacity: config.showSearch ? 1 : 0
// Behavior on opacity {
Expand All @@ -230,7 +238,6 @@ Item {
id: searchField
// width: 430
height: config.searchFieldHeight
anchors.leftMargin: config.sidebarWidth + config.sidebarRightMargin
anchors.left: parent.left
anchors.right: parent.right

Expand Down
2 changes: 1 addition & 1 deletion package/contents/ui/SidebarFavouritesView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import QtQuick 2.0
Repeater {
id: repeater
property int maxHeight: 1000000
property int numAvailable: maxHeight / config.flatButtonSize
property int numAvailable: 0
property int minVisibleIndex: count - numAvailable // Hide items with an index smaller than this

delegate: SidebarItem {
Expand Down
9 changes: 0 additions & 9 deletions package/contents/ui/SidebarItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,4 @@ FlatButton {
submenu.open = !submenu.open
}
}

QQC2.ToolTip {
id: control
visible: sidebarItem.hovered && !(sidebarItem.expanded || sidebarItem.submenuOpen)
text: sidebarItem.text
delay: 0
x: parent.width + rightPadding
y: (parent.height - height) / 2
}
}
13 changes: 5 additions & 8 deletions package/contents/ui/SidebarMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import org.kde.plasma.components 2.0 as PlasmaComponents

MouseArea {
id: sidebarMenu
hoverEnabled: true
hoverEnabled: false
z: 1
// clip: true
width: open ? config.sidebarOpenWidth : config.sidebarWidth
property bool open: false
clip: true
implicitWidth: 480
implicitHeight: 128
property bool open: true

onOpenChanged: {
if (open) {
Expand All @@ -23,20 +24,17 @@ MouseArea {
}

Rectangle {
anchors.fill: parent
visible: !plasmoid.configuration.sidebarFollowsTheme
color: config.sidebarBackgroundColor
opacity: parent.open ? 1 : 0
}

Rectangle {
anchors.fill: parent
visible: plasmoid.configuration.sidebarFollowsTheme
color: theme.backgroundColor
opacity: parent.open ? 1 : 0
}
PlasmaCore.FrameSvgItem {
anchors.fill: parent
visible: plasmoid.configuration.sidebarFollowsTheme
imagePath: "widgets/frame"
prefix: "raised"
Expand All @@ -45,7 +43,6 @@ MouseArea {
property alias showDropShadow: sidebarMenuShadows.visible
SidebarMenuShadows {
id: sidebarMenuShadows
anchors.fill: parent
visible: !plasmoid.configuration.sidebarFollowsTheme && sidebarMenu.open
}
}
77 changes: 13 additions & 64 deletions package/contents/ui/SidebarView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,29 @@ Item {
id: sidebarView
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
height: 32
z: 1

width: sidebarMenu.width
width: 480
Behavior on width { NumberAnimation { duration: 100 } }

DragAndDrop.DropArea {
anchors.fill: sidebarMenu

onDrop: {
if (event && event.mimeData && event.mimeData.url) {
var url = event.mimeData.url.toString()
url = Utils.parseDropUrl(url)
appsModel.sidebarModel.addFavorite(url, 0)
}
}
}

SidebarMenu {
id: sidebarMenu
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom


Column {
id: sidebarMenuTop
Row {
width: parent.width
height: childrenRect.height

// SidebarItem {
// iconName: 'open-menu-symbolic'
// text: i18n("Menu")
// closeOnClick: false
// onClicked: sidebarMenu.open = !sidebarMenu.open
// zoomOnPush: expanded
// }

SidebarViewButton {
appletIconName: "view-tilesonly"
text: i18n("Tiles Only")
onClicked: searchView.showTilesOnly()
checked: searchView.showingOnlyTiles
}
SidebarViewButton {
appletIconName: "view-list-alphabetically"
text: i18n("Alphabetical")
onClicked: appsView.showAppsAlphabetically()
checked: searchView.showingAppsAlphabetically
}
SidebarViewButton {
appletIconName: 'view-list-categorically'
text: i18n("Categories")
onClicked: appsView.showAppsCategorically()
checked: searchView.showingAppsCategorically
}
// SidebarItem {
// iconName: 'system-search-symbolic'
// text: i18n("Search")
// onClicked: searchResultsView.showDefaultSearch()
// // checked: stackView.currentItem == searchResultsView
// // checkedEdge: Qt.RightEdge
// // checkedEdgeWidth: 4 * units.devicePixelRatio // Twice as thick as normal
// }
}
Column {
width: parent.width
height: childrenRect.height
anchors.bottom: parent.bottom
height: 480
anchors.top: parent.top

SidebarItem {
iconName: kuser.faceIconUrl ? kuser.faceIconUrl : 'user-identity'
text: kuser.fullName
submenu: userMenu
width: 230

SidebarContextMenu {
id: userMenu
Expand All @@ -97,24 +46,24 @@ Item {
iconName: 'system-users'
text: i18n("User Manager")
onClicked: KCMShell.open('user_manager')
visible: KCMShell.authorize('user_manager.desktop').length > 0
visible: KCMShell.authorize('user_manager.desktop').length > 64
}

Label {
anchors.top: parent.top
text: i18n("user-identity")
}

SidebarItemRepeater {
model: appsModel.sessionActionsModel
}
}
}

SidebarFavouritesView {
model: appsModel.sidebarModel
maxHeight: sidebarMenu.height - sidebarMenuTop.height - 2 * config.flatButtonSize
}

SidebarItem {
iconName: 'system-shutdown-symbolic'
text: i18n("Power")
submenu: powerMenu
width: 32

SidebarContextMenu {
id: powerMenu
Expand Down
Loading

0 comments on commit ed802ed

Please sign in to comment.