Skip to content

Commit

Permalink
Add Always show Search bar property, remove unwanted properties
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Jul 5, 2021
1 parent bbee3e4 commit 6074f9f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 53 deletions.
12 changes: 0 additions & 12 deletions contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
<label>The format used in the display of application names: 0 = NameOnly, 1 = GenericNameOnly, 2 = NameAndGenericName, 3 = GenericNameAndName</label>
<default>0</default>
</entry>
<entry name="limitDepth" type="Bool">
<label>Whether to flatten top-level menu categories to a single level instead of displaying sub-categories.</label>
<default>false</default>
</entry>
<entry name="alphaSort" type="Bool">
<label>Whether to sort menu contents alphabetically or use manual/system sort order.</label>
<default>false</default>
</entry>

<entry name="recentOrdering" type="Int">
<label>How should the previously used apps/docs/contacts be ordered: 0 = RecentFirst, 1 = PopularFirst</label>
Expand Down Expand Up @@ -134,10 +126,6 @@
<label>Shows or hides the Power Options button on the bottom bar.</label>
<default>true</default>
</entry>
<entry name="showIconsRootLevel" type="Bool">
<label>Whether to show icons on the root level of the menu.</label>
<default>false</default>
</entry>
<entry name="defaultAllApps" type="Bool">
<label>Whether to show All Apps screen by default or not.</label>
<default>false</default>
Expand Down
38 changes: 6 additions & 32 deletions contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ Kirigami.FormLayout {
property string cfg_customButtonImage: plasmoid.configuration.customButtonImage

property alias cfg_appNameFormat: appNameFormat.currentIndex
property alias cfg_limitDepth: limitDepth.checked
property alias cfg_alphaSort: alphaSort.checked
property alias cfg_showIconsRootLevel: showIconsRootLevel.checked

property alias cfg_recentOrdering: recentOrdering.currentIndex
property alias cfg_showRecentApps: showRecentApps.checked
property alias cfg_showRecentDocs: showRecentDocs.checked
Expand All @@ -58,6 +54,7 @@ Kirigami.FormLayout {
property alias cfg_gridAllowTwoLines: gridAllowTwoLines.checked
property alias cfg_defaultAllApps: defaultAllApps.checked
property alias cfg_showDescription: showDescription.checked
property alias cfg_alwaysShowSearchBar: alwaysShowSearchBar.checked

property alias cfg_downIconsDocuments: downIconsDocuments.checked
property alias cfg_downIconsDownloads: downIconsDownloads.checked
Expand Down Expand Up @@ -229,6 +226,11 @@ Kirigami.FormLayout {
text: i18n("Show Description for all apps and search items")
}

CheckBox {
id: alwaysShowSearchBar
text: i18n("Always Show Search Bar")
}

Item {
Kirigami.FormData.isSection: true
}
Expand All @@ -240,34 +242,6 @@ Kirigami.FormLayout {

model: [i18n("Name only"), i18n("Description only"), i18n("Name (Description)"), i18n("Description (Name)")]
}

Item {
Kirigami.FormData.isSection: true
}

CheckBox {
id: alphaSort

Kirigami.FormData.label: i18n("Behavior:")

text: i18n("Sort applications alphabetically")
}

CheckBox {
id: limitDepth

visible: !isDash

text: i18n("Flatten sub-menus to a single level")
}

CheckBox {
id: showIconsRootLevel

visible: !isDash

text: i18n("Show icons on the root level of the menu")
}

Item {
Kirigami.FormData.isSection: true
Expand Down
7 changes: 4 additions & 3 deletions contents/ui/MainColumnItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Item {
id: searchField
focus: true
placeholderText: i18n("Search...")
opacity: searching
opacity: searching || plasmoid.configuration.alwaysShowSearchBar
height: units.iconSizes.medium
width: parent.width - 2 * x
x: 1.5 * units.largeSpacing
Expand Down Expand Up @@ -216,8 +216,9 @@ Item {

PlasmaExtras.Heading {
id: mainLabelGrid
anchors.top: parent.top
anchors.top: plasmoid.configuration.alwaysShowSearchBar ? searchField.bottom : parent.top
anchors.leftMargin: units.largeSpacing * 3
anchors.topMargin: plasmoid.configuration.alwaysShowSearchBar ? 0.4 * units.largeSpacing : 0
anchors.left: parent.left
x: units.smallSpacing
elide: Text.ElideRight
Expand Down Expand Up @@ -476,7 +477,7 @@ Item {
left: parent.left
}
x: -units.smallSpacing
visible: documentsFavoritesGrid.model.count > 6 && !searching && !showAllApps && !showRecents
visible: documentsFavoritesGrid.model != null && documentsFavoritesGrid.model.count > 6 && !searching && !showAllApps && !showRecents
}

ItemGridView {
Expand Down
6 changes: 1 addition & 5 deletions contents/ui/MenuRepresentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ PlasmaCore.Dialog {
property int cellWidthSide: units.gridUnit * 13
property int cellHeight: iconSize + (Math.max(highlightItemSvg.margins.top + highlightItemSvg.margins.bottom,
highlightItemSvg.margins.left + highlightItemSvg.margins.right))
signal appendSearchText(string text)

onVisibleChanged: {
if (!visible) {
Expand Down Expand Up @@ -125,7 +124,7 @@ PlasmaCore.Dialog {
FocusScope {
Layout.minimumWidth: mainColumnItem.width //+ tilesColumnItem.width
Layout.maximumWidth: mainColumnItem.width //+ tilesColumnItem.width
Layout.minimumHeight: mainColumnItem.tileSide * 6 + 85
Layout.minimumHeight: mainColumnItem.tileSide * 6 + 85 + (plasmoid.configuration.alwaysShowSearchBar ? 15 : 0)
Layout.maximumHeight: mainColumnItem.tileSide * 6 + 85

focus: true
Expand All @@ -136,9 +135,6 @@ PlasmaCore.Dialog {

MainColumnItem{
id: mainColumnItem
onNewTextQuery: {
appendSearchText(text)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Item {

appNameFormat: plasmoid.configuration.appNameFormat
flat: true
sorted: plasmoid.configuration.alphaSort
sorted: true
showSeparators: false
appletInterface: plasmoid

Expand Down

0 comments on commit 6074f9f

Please sign in to comment.