Commit f17eae91 authored by pontaoski's avatar pontaoski 🌈
Browse files

Refine style of add widget sidebar

parent 40499005
......@@ -119,7 +119,7 @@ Item {
width: runningBadge.width + Math.round(units.smallSpacing * 1.5)
height: width
radius: height
visible: running
visible: running && list.currentIndex == index
}
}
......@@ -129,7 +129,7 @@ Item {
height: Math.round(theme.mSize(countLabel.font).height * 1.3)
radius: height
color: theme.highlightColor
visible: running
visible: running && list.currentIndex == index
onVisibleChanged: maskShaderSource.scheduleUpdate()
PlasmaComponents.Label {
......@@ -179,7 +179,7 @@ Item {
tooltip: delegate.pendingUninstall ? i18nd("plasma_shell_org.kde.plasma.desktop", "Undo uninstall")
: i18nd("plasma_shell_org.kde.plasma.desktop", "Uninstall widget")
flat: false
visible: model.local
visible: model.local && list.currentIndex == index
onHoveredChanged: {
if (hovered) {
// hovering the uninstall button triggers onExited of the main mousearea
......
......@@ -25,6 +25,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kwindowsystem 1.0
import org.kde.kirigami 2.10 as Kirigami
import QtQuick.Window 2.1
import QtQuick.Layouts 1.1
......@@ -196,68 +197,74 @@ Item {
*/
RowLayout {
id: topBar
PlasmaExtras.PlasmoidHeading {
id: topArea
implicitWidth: header.implicitWidth
implicitHeight: header.implicitHeight
anchors {
top: parent.top
left: parent.left
right: parent.right
}
Item {
ColumnLayout {
id: header
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
PlasmaExtras.Heading {
id: heading
anchors.verticalCenter: parent.verticalCenter
level: 1
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Widgets")
width: parent.width
elide: Text.ElideRight
}
}
anchors.fill: parent
PlasmaComponents.ToolButton {
id: categoryButton
tooltip: i18nd("plasma_shell_org.kde.plasma.desktop", "Categories")
iconSource: "view-filter"
onClicked: {
categoriesDialog.model = widgetExplorer.filterModel
categoriesDialog.open(0, categoryButton.height)
RowLayout {
Kirigami.Heading {
id: heading
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Widgets")
elide: Text.ElideRight
}
Item { Layout.fillWidth: true }
PlasmaComponents.ToolButton {
id: categoryButton
tooltip: i18nd("plasma_shell_org.kde.plasma.desktop", "Categories")
iconSource: "view-filter"
onClicked: {
categoriesDialog.model = widgetExplorer.filterModel
categoriesDialog.open(0, categoryButton.height)
}
}
PlasmaComponents.ToolButton {
id: closeButton
iconSource: "window-close"
onClicked: main.closed()
}
}
}
PlasmaComponents.ToolButton {
id: closeButton
iconSource: "window-close"
onClicked: main.closed()
}
}
RowLayout {
id: newSearchRow
anchors.top: topBar.bottom
anchors.topMargin: units.smallSpacing
width: topBar.width
PlasmaComponents.TextField {
id: searchInput
Layout.fillWidth: true
clearButtonShown: true
placeholderText: i18nd("plasma_shell_org.kde.plasma.desktop", "Search...")
onTextChanged: {
list.positionViewAtBeginning()
list.currentIndex = -1
widgetExplorer.widgetsModel.searchTerm = text
RowLayout {
PlasmaComponents.TextField {
id: searchInput
Layout.fillWidth: true
clearButtonShown: true
placeholderText: i18nd("plasma_shell_org.kde.plasma.desktop", "Search...")
onTextChanged: {
list.positionViewAtBeginning()
list.currentIndex = -1
widgetExplorer.widgetsModel.searchTerm = text
}
Component.onCompleted: forceActiveFocus()
}
Component.onCompleted: forceActiveFocus()
PlasmaComponents.ToolButton {
id: getWidgetsButton
iconSource: "get-hot-new-stuff"
tooltip: i18nd("plasma_shell_org.kde.plasma.desktop", "Get New Widgets...")
onClicked: {
getWidgetsDialog.model = widgetExplorer.widgetsMenuActions
getWidgetsDialog.openRelative()
}
}
}
Item {
height: units.smallSpacing
}
}
}
Timer {
id: setModelTimer
interval: 20
......@@ -267,12 +274,10 @@ Item {
PlasmaExtras.ScrollArea {
anchors {
top: newSearchRow.bottom
top: topArea.bottom
left: parent.left
right: parent.right
bottom: bottomBar.top
bottomMargin: units.smallSpacing
topMargin: units.smallSpacing
bottom: parent.bottom
}
verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
......@@ -345,29 +350,4 @@ Item {
}
}
}
Column {
id: bottomBar
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
spacing: units.smallSpacing
PlasmaComponents.Button {
id: getWidgetsButton
anchors {
left: parent.left
right: parent.right
}
iconSource: "get-hot-new-stuff"
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Get New Widgets...")
onClicked: {
getWidgetsDialog.model = widgetExplorer.widgetsMenuActions
getWidgetsDialog.openRelative()
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment