• KDE Tweaking - App Launcher - Center Application Tab


    Hey,

    I have been making some tweaks to the application launcher and now I can’t figure out this one thing.

    If you take a look at this screenshot - http://imgur.com/a/r7VFb - you can see that the tab at the bottom “Applications” is off to the left. I am looking to have that centered like everything else.

    I have the correct file to make changes to this entire application launcher just can’t figure out what would make that tab center. I have uploaded a copy of the file in question here - https://cl.ly/lfau.

    Ideas?

  • Actually, as I think about it more.

    Removing that entire tab area would be good now that I only use one tab…any ideas?

  • Unfortunately, I don’t really have any good ideas to offer you:disappointed:. However, I am curious as to where that specific file for editing the menu is. I might start tinkering around with it myself! (And I’ll make sure to post it’s default content here for you to see before I mess around with it at all:slight_smile:).

    Thanks!

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • Sure.

    I found the file under:

    /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/FullRepresentation.qml

    But the UI folder has all kinds of stuff there.

  • Thanks! However, when I attempt to open the file, it says "Could Not Display Name_of_File.qml There is no application installed for “QTMarkup Language File” files.

    What should i install in order to open it?

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • I assumed anything would open it but I was opening it with Leafpad

  • @noobertroon said in KDE Tweaking - App Launcher - Center Application Tab:

    I was opening it with Leafpad

    Thank you! Leafpad is working for me:grinning:.

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • Here’s the default config:


    /*
        Copyright (C) 2011  Martin Gräßlin <[email protected]>
        Copyright (C) 2012  Gregor Taetzner <[email protected]>
        Copyright (C) 2012  Marco Martin <[email protected]>
        Copyright (C) 2013 2014 David Edmundson <[email protected]>
        Copyright 2014 Sebastian Kügler <[email protected]>
    
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
    
        You should have received a copy of the GNU General Public License along
        with this program; if not, write to the Free Software Foundation, Inc.,
        51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    */
    import QtQuick 2.3
    import org.kde.plasma.plasmoid 2.0
    import QtQuick.Layouts 1.1
    import org.kde.plasma.core 2.0 as PlasmaCore
    import org.kde.plasma.components 2.0 as PlasmaComponents
    import org.kde.plasma.extras 2.0 as PlasmaExtras
    import org.kde.kquickcontrolsaddons 2.0
    
    import org.kde.plasma.private.kicker 0.1 as Kicker
    
    Item {
        id: root
        Layout.minimumWidth: units.gridUnit * 26
        Layout.minimumHeight: units.gridUnit * 34
    
        property string previousState
        property bool switchTabsOnHover: plasmoid.configuration.switchTabsOnHover
        property Item currentView: mainTabGroup.currentTab.decrementCurrentIndex ? mainTabGroup.currentTab : mainTabGroup.currentTab.item
        property KickoffButton firstButton: null
        property var configMenuItems
    
        property QtObject globalFavorites: rootModelFavorites
    
        state: "Normal"
        focus: true
    
        function switchToInitial() {
            if(firstButton != null) {
                mainTabGroup.currentTab = firstButton.tab;
                tabBar.currentTab = firstButton;
                header.query = ""
                header.state = "hint";
                root.state = "Normal";
            }
        }
    
        Kicker.AppsModel {
            id: rootModel
    
            appletInterface: plasmoid
    
            appNameFormat: plasmoid.configuration.showAppsByName ? 0 : 1
            flat: false
            sorted: plasmoid.configuration.alphaSort
            showSeparators: false
    
            favoritesModel: Kicker.FavoritesModel {
                id: rootModelFavorites
                favorites: plasmoid.configuration.favorites
    
                onFavoritesChanged: {
                    plasmoid.configuration.favorites = favorites;
                }
            }
        }
    
        Kicker.RunnerModel {
            id: runnerModel
    
            appletInterface: plasmoid
    
            runners: {
                var runners = ["services", "places", "desktopsessions",
                               "PowerDevil"];
    
                if (plasmoid.configuration.useExtraRunners) {
                    runners = runners.concat(plasmoid.configuration.runners);
                }
                return runners;
            }
            mergeResults: true
    
            favoritesModel: globalFavorites
        }
    
        PlasmaCore.DataSource {
            id: pmSource
            engine: "powermanagement"
            connectedSources: ["PowerDevil"]
        }
    
        PlasmaCore.Svg {
            id: lineSvg
            imagePath: "widgets/line"
        }
    
        PlasmaCore.Svg {
            id: arrowsSvg
    
            imagePath: "widgets/arrows"
            size: "16x16"
        }
    
        Timer {
            id: clickTimer
    
            property Item pendingButton
    
            interval: 250
    
            onTriggered: pendingButton.clicked()
        }
    
        Header {
            id: header
        }
    
        Item {
            id: mainArea
            anchors.topMargin: mainTabGroup.state == "top" ? units.smallSpacing : 0
    
            PlasmaComponents.TabGroup {
                id: mainTabGroup
                currentTab: favoritesPage
    
                anchors {
                    fill: parent
                }
    
                //pages
                FavoritesView {
                    id: favoritesPage
                }
                PlasmaExtras.ConditionalLoader {
                    id: applicationsPage
                    when: mainTabGroup.currentTab == applicationsPage
                    source: Qt.resolvedUrl("ApplicationsView.qml")
                }
                PlasmaExtras.ConditionalLoader {
                    id: systemPage
                    when: mainTabGroup.currentTab == systemPage
                    source: Qt.resolvedUrl("ComputerView.qml")
                }
                PlasmaExtras.ConditionalLoader {
                    id: recentlyUsedPage
                    when: mainTabGroup.currentTab == recentlyUsedPage
                    source: Qt.resolvedUrl("RecentlyUsedView.qml")
                }
                PlasmaExtras.ConditionalLoader {
                    id: oftenUsedPage
                    when: mainTabGroup.currentTab == oftenUsedPage
                    source: Qt.resolvedUrl("OftenUsedView.qml")
                }
                PlasmaExtras.ConditionalLoader {
                    id: leavePage
                    when: mainTabGroup.currentTab == leavePage
                    source: Qt.resolvedUrl("LeaveView.qml")
                }
                PlasmaExtras.ConditionalLoader {
                    id: searchPage
                    when: root.state == "Search"
                    //when: mainTabGroup.currentTab == searchPage || root.state == "Search"
                    source: Qt.resolvedUrl("SearchView.qml")
                }
    
                state: {
                    switch (plasmoid.location) {
                    case PlasmaCore.Types.LeftEdge:
                        return LayoutMirroring.enabled ? "right" : "left";
                    case PlasmaCore.Types.TopEdge:
                        return "top";
                    case PlasmaCore.Types.RightEdge:
                        return LayoutMirroring.enabled ? "left" : "right";
                    case PlasmaCore.Types.BottomEdge:
                    default:
                        return "bottom";
                    }
                }
                states: [
                    State {
                        name: "left"
                        AnchorChanges {
                            target: header
                            anchors {
                                left: root.left
                                top: undefined
                                right: root.right
                                bottom: root.bottom
                            }
                        }
                        PropertyChanges {
                            target: header
                            width: header.implicitWidth
                        }
    
                        AnchorChanges {
                            target: mainArea
                            anchors {
                                left: tabBar.right
                                top: root.top
                                right: root.right
                                bottom: header.top
                            }
                        }
    
                        AnchorChanges {
                            target: tabBar
                            anchors {
                                left: root.left
                                top: root.top
                                right: undefined
                                bottom: header.top
                            }
                        }
                    },
                    State {
                        name: "top"
                        AnchorChanges {
                            target: header
                            anchors {
                                left: root.left
                                top: undefined
                                right: root.right
                                bottom: root.bottom
                            }
                        }
                        PropertyChanges {
                            target: header
                            height: header.implicitHeight
                        }
    
                        AnchorChanges {
                            target: mainArea
                            anchors {
                                left: root.left
                                top: tabBar.bottom
                                right: root.right
                                bottom: header.top
                            }
                        }
    
                        AnchorChanges {
                            target: tabBar
                            anchors {
                                left: root.left
                                top: root.top
                                right: root.right
                                bottom: undefined
                            }
                        }
                    },
                    State {
                        name: "right"
                        AnchorChanges {
                            target: header
                            anchors {
                                left: root.left
                                top: undefined
                                right: root.right
                                bottom: root.bottom
                            }
                        }
                        PropertyChanges {
                            target: header
                            width: header.implicitWidth
                        }
    
                        AnchorChanges {
                            target: mainArea
                            anchors {
                                left: root.left
                                top: root.top
                                right: tabBar.left
                                bottom: header.top
                            }
                        }
    
                        AnchorChanges {
                            target: tabBar
                            anchors {
                                left: undefined
                                top: root.top
                                right: root.right
                                bottom: header.top
                            }
                        }
                    },
                    State {
                        name: "bottom"
                        AnchorChanges {
                            target: header
                            anchors {
                                left: root.left
                                top: root.top
                                right: root.right
                                bottom: undefined
                            }
                        }
                        PropertyChanges {
                            target: header
                            height: header.implicitHeight
                        }
    
                        AnchorChanges {
                            target: mainArea
                            anchors {
                                left: root.left
                                top: header.bottom
                                right: root.right
                                bottom: tabBar.top
                            }
                        }
    
                        AnchorChanges {
                            target: tabBar
                            anchors {
                                left: root.left
                                top: undefined
                                right: root.right
                                bottom: root.bottom
                            }
                        }
                    }
                ]
            } // mainTabGroup
        }
    
        PlasmaComponents.TabBar {
            id: tabBar
    
            width: {
                if (!visible) {
                    return 0;
                }
    
                switch (plasmoid.location) {
                case PlasmaCore.Types.LeftEdge:
                case PlasmaCore.Types.RightEdge:
                    return units.gridUnit * 5;
                default:
                    return 0;
                }
            }
    
            height: {
                if (!visible) {
                    return 0;
                }
    
                switch (plasmoid.location) {
                case PlasmaCore.Types.LeftEdge:
                case PlasmaCore.Types.RightEdge:
                    return 0;
                default:
                    return units.gridUnit * 5;
                }
            }
    
            Behavior on width {
                NumberAnimation { duration: units.longDuration; easing.type: Easing.InQuad; }
                enabled: plasmoid.expanded
            }
            Behavior on height {
                NumberAnimation { duration: units.longDuration; easing.type: Easing.InQuad; }
                enabled: plasmoid.expanded
            }
    
            tabPosition: {
                switch (plasmoid.location) {
                case PlasmaCore.Types.TopEdge:
                    return Qt.TopEdge;
                case PlasmaCore.Types.LeftEdge:
                    return Qt.LeftEdge;
                case PlasmaCore.Types.RightEdge:
                    return Qt.RightEdge;
                default:
                    return Qt.BottomEdge;
                }
            }
    
            onCurrentTabChanged: root.forceActiveFocus();
    
            Connections {
                target: plasmoid
                onExpandedChanged: {
                    if(menuItemsChanged()) {
                        createButtons();
                    }
                    if (!expanded) {
                        switchToInitial()
                    }
                }
            }
        } // tabBar
    
        Keys.forwardTo: [tabBar.layout]
    
        Keys.onPressed: {
    
            if (mainTabGroup.currentTab == applicationsPage) {
                if (event.key != Qt.Key_Tab) {
                    root.state = "Applications";
                }
            }
    
            switch(event.key) {
                case Qt.Key_Up: {
                    currentView.decrementCurrentIndex();
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Down: {
                    currentView.incrementCurrentIndex();
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Left: {
                    if (header.input.focus) {
                        break;
                    }
                    if (!currentView.deactivateCurrentIndex()) {
                        if (root.state == "Applications") {
                            mainTabGroup.currentTab = firstButton.tab;
                            tabBar.currentTab = firstButton;
                        }
                        root.state = "Normal"
                    }
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Right: {
                    if (header.input.focus) {
                        break;
                    }
                    currentView.activateCurrentIndex();
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Tab: {
                    root.state == "Applications" ? root.state = "Normal" : root.state = "Applications";
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Enter:
                case Qt.Key_Return: {
                    currentView.activateCurrentIndex(1);
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Escape: {
                    if (header.state != "query") {
                        plasmoid.expanded = false;
                    } else {
                        switchToInitial();
                    }
                    event.accepted = true;
                    break;
                }
                case Qt.Key_Menu: {
                    currentView.openContextMenu();
                    event.accepted = true;
                    break;
                }
    
                default: { // forward key to searchView
                    //header.query += event.text will break if the key is backspace,
                    //since if the user continues to type, it will produce an invalid query,
                    //having backspace as the first character
                    if (event.key == Qt.Key_Backspace && header.query == "") {
                        return;
                    }
                    if (event.text != "" && !header.input.focus) {
                        root.currentView.listView.currentIndex = -1;
    
                        if (event.matches(StandardKey.Paste) ) {
                            header.input.paste();
                        } else if (! (event.key & Qt.Key_Escape)) {
                            //if special key, do nothing. Qt.Escape is 0x10000000 which happens to be a mask used for all special keys in Qt.
                            header.query = "";
                            header.query += event.text;
                        }
                        header.input.forceActiveFocus();
                        event.accepted = true;
                    }
                }
            }
        }
    
        states: [
            State {
                name: "Normal"
                PropertyChanges {
                    target: root
                    Keys.forwardTo: [tabBar.layout]
                }
                PropertyChanges {
                    target: tabBar
                    visible: true
                }
            },
            State {
                name: "Applications"
                PropertyChanges {
                    target: root
                    Keys.forwardTo: [root]
                }
                PropertyChanges {
                    target: tabBar
                    visible: true
                }
            },
            State {
                name: "Search"
                PropertyChanges {
                    target: tabBar
                    visible: false
                }
                PropertyChanges {
                    target: mainTabGroup
                    currentTab: searchPage
                }
            }
        ] // states
    
        function getButtonDefinition(name) {
            switch(name) {
            case "bookmark":
                return {id: "bookmarkButton", tab: favoritesPage, iconSource: "bookmarks", text: i18n("Favorites")};
            case "application":
                return {id: "applicationButton", tab: applicationsPage, iconSource: "applications-other", text: i18n("Applications")};
            case "computer":
                return {id: "computerButton", tab: systemPage, iconSource: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Is Lid Present"] ? "computer-laptop" : "computer", text: i18n("Computer")};
            case "used":
                return {id: "usedButton", tab: recentlyUsedPage, iconSource: "view-history", text: i18n("History")};
            case "oftenUsed":
                return {id: "usedButton", tab: oftenUsedPage, iconSource: "office-chart-pie", text: i18n("Often Used")};
            case "leave":
                return {id: "leaveButton", tab: leavePage, iconSource: "system-log-out", text: i18n("Leave")};
            }
        }
    
        Component {
            id: kickoffButton
            KickoffButton {}
        }
    
    
        Component.onCompleted: {
            createButtons();
        }
    
        function getEnabled(configuration) {
            var res = [];
            for(var i = 0; i < configuration.length; i++) {
                var confItemName = configuration[i].substring(0, configuration[i].indexOf(":"));
                var confItemEnabled = configuration[i].substring(configuration[i].length-1) == "t";
                if(confItemEnabled) {
                    res.push(confItemName);
                }
            }
    
            return res;
        }
    
        function createButtons() {
            configMenuItems = plasmoid.configuration.menuItems;
            var menuItems = getEnabled(plasmoid.configuration.menuItems);
    
            // remove old menu items
            for(var i = tabBar.layout.children.length -1; i >= 0; i--)  {
                if(tabBar.layout.children[i].objectName == "KickoffButton") {
                    tabBar.layout.children[i].destroy();
                }
            }
    
            for (var i = 0; i < menuItems.length; i++) {
                 var props = getButtonDefinition(menuItems[i]);
                 var button = kickoffButton.createObject(tabBar.layout, props);
                 if(i == 0) {
                     firstButton = button;
                     switchToInitial();
                 }
            }
    
        }
    
        function menuItemsChanged() {
            if(configMenuItems.length != plasmoid.configuration.menuItems.length) {
                return true;
            }
    
            for(var i = 0; i < configMenuItems.length; i++) {
                if(configMenuItems[i] != plasmoid.configuration.menuItems[i]) {
                    return true;
                }
            }
            return false;
        }
    }
    

    Hope this all helps!

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • I guess you didn’t have any luck tweaking it yourself, or maybe finding out how to remove the tabs like I wanted? hehe

  • Not really:disappointed:. I haven’t even gotten much of a chance to, what with me wrecking my Antergos setup on accident lately. However, that just got fixed in it’s entirety today! But at least my earlier post should have helped you fix your custom config up a bit:grinning:.

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • I don’t understand.

    You posted the default file. How does that help me?

    I am looking for how to remove the tabs from the menu using that file. Seeing the default one does not help me in that regard?

  • @noobertroon said in KDE Tweaking - App Launcher - Center Application Tab:

    Removing that entire tab area would be good now that I only use one tab…any ideas?

    I thought the default config might help a little here since it would at least let you look at your problem with a fresh, untampered start. It wasn’t much, but it’s all the advice I have right now. (I’ve used Gnome for most of my Linux career, and just switched to Plasma. So I’m kind of new to this:smile:).Plus, if you ever mess up your config too badly, this would offer an easy reset button ;).

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • Ah I see.

    Yea I didn’t make all that many changes to accomplish what I did so I pretty much have the default config.

    I appreciate that though.

  • @noobertroon said in KDE Tweaking - App Launcher - Center Application Tab:

    I didn’t make all that many changes to accomplish what I did so I pretty much have the default config.

    OK. I didn’t know that. I don’t think I can really help much then…

    Keep trying, never give up. In the end, you will find that it was all worth it

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

kde105 tweaking1 launcher6 app10 Posts 14Views 403
Log in to reply