~ubuntu-branches/ubuntu/trusty/kde-workspace/trusty

« back to all changes in this revision

Viewing changes to plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.defaultPanel/contents/layout.js

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-03-28 23:22:07 UTC
  • mfrom: (1.6.7)
  • Revision ID: package-import@ubuntu.com-20140328232207-chricirf2ojtz0a2
Tags: 4:4.11.8-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
var panel = new Panel
2
 
if (panelIds.length == 1) {
3
 
    // we are the only panel, so set the location for the user
4
 
    panel.location = 'bottom'
 
2
var panelScreen = panel.screen
 
3
var freeEdges = {"bottom": true, "top": true, "left": true, "right": true}
 
4
 
 
5
for (i = 0; i < panelIds.length; ++i) {
 
6
    var tmpPanel = panelById(panelIds[i])
 
7
    if (tmpPanel.screen == panelScreen) {
 
8
        // Ignore the new panel
 
9
        if (tmpPanel.id != panel.id) {
 
10
            freeEdges[tmpPanel.location] = false;
 
11
        }
 
12
    }
 
13
}
 
14
 
 
15
if (freeEdges["bottom"] == true) {
 
16
    panel.location = "bottom";
 
17
} else if (freeEdges["top"] == true) {
 
18
    panel.location = "top";
 
19
} else if (freeEdges["left"] == true) {
 
20
    panel.location = "left";
 
21
} else if (freeEdges["right"] == true) {
 
22
    panel.location = "right";
 
23
} else {
 
24
    // There is no free edge, so leave the default value
 
25
    panel.location = "top";
5
26
}
6
27
 
7
28
panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27