This file is indexed.

/usr/share/plasma/shells/org.kde.plasma.mediacenter/contents/views/Panel.qml is in plasma-mediacenter 4:5.5.5-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
 *  Copyright 2012 Marco Martin <mart@kde.org>
 *
 *  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  2.010-1301, USA.
 */

import QtQuick 2.0
import QtQuick.Layouts 1.1

import org.kde.plasma.core 2.0 as PlasmaCore


PlasmaCore.FrameSvgItem {
    id: root
    width: containment && containment.formFactor == PlasmaCore.Types.Vertical ? panel.thickness : panel.length
    height: containment && containment.formFactor == PlasmaCore.Types.Vertical ? panel.length : panel.thickness
    imagePath: "widgets/panel-background"
    prefix: {
        if (!containment) {
            return "";
        }
        var pre;
        switch (containment.location) {
        case PlasmaCore.Types.LeftEdge:
            pre = "west";
            break;
        case PlasmaCore.Types.TopEdge:
            pre = "north";
            break;
        case PlasmaCore.Types.RightEdge:
            pre = "east";
            break;
        case PlasmaCore.Types.BottomEdge:
            pre = "south";
            break;
        default:
            return "";
        }
        if (hasElementPrefix(pre)) {
            return pre;
        } else {
            return "";
        }

    }
    visible: false //adjust borders is run during setup. We want to avoid painting till completed

    property Item containment

    function adjustBorders() {
        var borders = PlasmaCore.FrameSvg.AllBorders;
        if (!containment) {
            return;
        }

        switch (containment.location) {
        case PlasmaCore.Types.TopEdge:
            borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
            break;
        case PlasmaCore.Types.LeftEdge:
            borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
            break;
        case PlasmaCore.Types.RightEdge:
            borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
            break;
        case PlasmaCore.Types.BottomEdge:
        default:
            borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
            break;
        }

        if (panel.x <= panel.screen.geometry.x) {
            borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
        }
        if (panel.x + panel.width >= panel.screen.geometry.x + panel.screen.geometry.width) {
            borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
        }
        if (panel.y <= panel.screen.geometry.y) {
            borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
        }
        if (panel.y + panel.height >= panel.screen.geometry.y + panel.screen.geometry.height) {
            borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
        }

        root.enabledBorders = borders;

        containmentParent.anchors.topMargin = Math.min(root.margins.top, Math.max(1, root.height - units.iconSizes.smallMedium));

        containmentParent.anchors.bottomMargin = Math.min(root.margins.bottom, Math.max(1, root.height - units.iconSizes.smallMedium));

        //Base the left/right margins on height as well, to have a good radial simmetry
        containmentParent.anchors.leftMargin = Math.min(root.margins.left, Math.max(1, root.height - units.iconSizes.smallMedium));

        containmentParent.anchors.leftMargin = Math.min(root.margins.left, Math.max(1, root.height - units.iconSizes.smallMedium));
    }

    onContainmentChanged: {
        containment.parent = containmentParent;
        containment.visible = true;
        containment.anchors.fill = containmentParent;

        containment.locationChanged.connect(adjustBorders);
        if (containment.Layout) {
            containment.Layout.minimumWidthChanged.connect(minimumWidthChanged);
            containment.Layout.maximumWidthChanged.connect(maximumWidthChanged);
            containment.Layout.preferredWidthChanged.connect(preferredWidthChanged);

            containment.Layout.minimumHeightChanged.connect(minimumHeightChanged);
            containment.Layout.maximumHeightChanged.connect(maximumHeightChanged);
            containment.Layout.preferredHeightChanged.connect(preferredHeightChanged);
        }
        adjustBorders();
    }

    function minimumWidthChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Horizontal) {
            panel.length = Math.max(panel.width, containment.Layout.minimumWidth);
        }
    }
    function maximumWidthChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Horizontal) {
            panel.length = Math.min(panel.width, containment.Layout.maximumWidth);
        }
    }
    function preferredWidthChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Horizontal) {
            panel.length = Math.min(panel.maximumLength, Math.max(containment.Layout.preferredWidth, panel.minimumLength));
        }
    }

    function minimumHeightChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Vertical) {
            panel.length = Math.max(panel.height, containment.Layout.minimumWidth);
        }
    }
    function maximumHeightChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Vertical) {
            panel.length = Math.min(panel.height, containment.Layout.maximumWidth);
        }
    }
    function preferredHeightChanged() {
        if (!containment.userConfiguring && containment.formFactor === PlasmaCore.Types.Vertical) {
            panel.length = Math.min(panel.maximumLength, Math.max(containment.Layout.preferredHeight, panel.minimumLength));
        }
    }

    Item {
        id: containmentParent
        anchors {
            fill: parent
            leftMargin: root.margins.left
            topMargin: root.margins.top
            rightMargin: root.margins.right
            bottomMargin: root.margins.bottom
        }
    }

    Connections {
        target: panel
        onXChanged: {
            adjustBorders();
        }
        onYChanged: {
            adjustBorders();
        }
        onWidthChanged: {
            adjustBorders();
        }
        onHeightChanged: {
            adjustBorders();
        }
    }

    Connections {
        target: panel.screen
        onGeometryChanged: {
            adjustBorders();
        }
    }

    Connections {
        target: containment
        onUserConfiguringChanged: {
            if (!containment.userConfiguring) {
                minimumWidthChanged();
                maximumWidthChanged();
                preferredWidthChanged();
                minimumHeightChanged();
                maximumHeightChanged();
                preferredHeightChanged();
            }
        }
    }

    Component.onCompleted: {
        adjustBorders();
        visible = true
    }
}