Skip to content

Commit

Permalink
Vertical panels
Browse files Browse the repository at this point in the history
Merges #4996 (ed note: had to squash this and broke link to PR)
Closes #629
  • Loading branch information
brownsr authored and mtwebster committed Aug 17, 2016
1 parent 18fad48 commit 86e14ef
Show file tree
Hide file tree
Showing 26 changed files with 2,988 additions and 824 deletions.
79 changes: 67 additions & 12 deletions data/theme/cinnamon.css
Expand Up @@ -248,45 +248,74 @@ StScrollBar StButton#vhandle:hover {
.panel-dummy:entered {
background-color: rgba(255, 35, 35, 0.4);
}
#panelLeft {
.panelLeft {
spacing: 4px;
}
#panelCenter {
.panelCenter {
spacing: 4px;
}
#panelLeft:dnd {
.panelRight {
spacing: 4px;
}
.panelLeft:dnd {
background-gradient-direction: vertical;
background-gradient-start: rgba(255,0,0,0.05);
background-gradient-end: rgba(255,0,0,0.2);
}
#panelCenter:dnd {
.panelCenter:dnd {
background-gradient-direction: vertical;
background-gradient-start: rgba(0,255,0,0.05);
background-gradient-end: rgba(0,255,0,0.2);
}
#panelRight:dnd {
.panelRight:dnd {
background-gradient-direction: vertical;
background-gradient-start: rgba(0,0,255,0.05);
background-gradient-end: rgba(0,0,255,0.2);
}
#panelLeft:ltr {
.panelLeft:ltr {
padding-right: 4px;
}
#panelLeft:rtl {
.panelLeft:rtl {
padding-left: 4px;
}
#panelRight:ltr {
.panelRight:ltr {
padding-left: 0px;
spacing: 0px;
}
#panelRight:rtl {
.panelRight:rtl {
padding-right: 0px;
spacing: 0px;
}
.panelLeft.vertical {
padding-left: 0px;
padding-right: 0px;
padding-top: 2px;
padding-bottom: 2px;
}
.panelRight.vertical {
padding-left: 0px;
padding-right: 0px;
padding-top: 2px;
padding-bottom: 2px;
}
.panelCenter.vertical {
padding-left: 0px;
padding-right: 0px;
}
.panelLeft.vertical:dnd {
}
.panelCenter.vertical:dnd {
}
.panelRight.vertical:dnd {
}
.panel-top {
}
.panel-bottom {
}
.panel-left {
}
.panel-right {
}
.panel-status-button {
border: 0px solid #8b8b8b;
-natural-hpadding: 3px;
Expand Down Expand Up @@ -1179,7 +1208,13 @@ StScrollBar StButton#vhandle:hover {
.window-list-box {
spacing: 3px;
padding-left: 10px;
padding-top: 1px;
padding-top: 0px;
}
.window-list-box.vertical {
padding-left: 0px;
padding-right: 0px;
padding-top: 10px;
padding-bottom: 10px;
}
.window-list-item-label {
font-weight: bold;
Expand Down Expand Up @@ -1343,6 +1378,12 @@ StScrollBar StButton#vhandle:hover {
#panel-launchers-box {
padding-left: 7px;
}
#panel-launchers-box.vertical {
padding-top: 2px;
padding-bottom: 2px;
padding-left:0px;
padding-right: 0px;
}
.panel-launcher {
margin: 1px;
padding: 1px;
Expand Down Expand Up @@ -1416,7 +1457,10 @@ StScrollBar StButton#vhandle:hover {
width: 2px;
background: rgba(255,255,255,.5);
}

.applet-separator-line-vertical {
border: 0px solid rgba(255,255,255,0.5);
border-bottom-width: 2px;
}
.applet-box {
padding-left: 3px;
padding-right: 3px;
Expand All @@ -1427,6 +1471,14 @@ StScrollBar StButton#vhandle:hover {
.applet-box:hover {
color: #fff;
}
.applet-box.vertical {
padding-left: 0px;
padding-right: 0px;
padding-top: 3px;
padding-bottom: 3px;
}
.applet-box.vertical:hover {
}
.applet-box:highlight {
background-color: #aa5555;
}
Expand All @@ -1438,6 +1490,8 @@ StScrollBar StButton#vhandle:hover {
color: #fff;
text-shadow: white 0px 0px 5px;
}
.applet-box.vertical:hover > .applet-label {
}
.applet-icon {
color: #ccc;
icon-size: 22px;
Expand All @@ -1446,7 +1500,8 @@ StScrollBar StButton#vhandle:hover {
color: #fff;
icon-shadow: white 0px 0px 3px;
}

.applet-box.vertical:hover .applet-icon {
}
/* ===================================================================
* Desklets (desklet.js)
* ===================================================================*/
Expand Down
7 changes: 7 additions & 0 deletions files/usr/share/cinnamon/applets/a11y@cinnamon.org/applet.js
Expand Up @@ -242,6 +242,13 @@ MyApplet.prototype = {

on_applet_removed_from_panel: function() {
Main.systrayManager.unregisterRole("a11y", this.metadata.uuid);
},
//
//override getDisplayLayout to declare that this applet is suitable for both horizontal and
// vertical orientations
//
getDisplayLayout: function() {
return Applet.DisplayLayout.BOTH;
}
};

Expand Down
30 changes: 22 additions & 8 deletions files/usr/share/cinnamon/applets/calendar@cinnamon.org/applet.js
Expand Up @@ -51,7 +51,7 @@ MyApplet.prototype = {

this.menuManager = new PopupMenu.PopupMenuManager(this);

this._orientation = orientation;
this.orientation = orientation;

this._initContextMenu();

Expand Down Expand Up @@ -139,10 +139,16 @@ MyApplet.prototype = {
_updateClockAndDate: function() {
let now = new Date();
let nextUpdate = 60 - now.getSeconds() + 1;

let in_vertical_panel = (this.orientation == St.Side.LEFT || this.orientation == St.Side.RIGHT);
let label_string;

// Applet label
if (this.use_custom_format) {
let label_string = now.toLocaleFormat(this.custom_format);
if (this.use_custom_format || in_vertical_panel) {
if (in_vertical_panel)
label_string = now.toLocaleFormat("%H%n%M"); // this is all that will fit in a vertical panel with a typical default font
else
label_string = now.toLocaleFormat(this.custom_format);

if (!label_string) {
global.logError("Calendar applet: bad time format string - check your string.");
label_string = "~CLOCK FORMAT ERROR~ " + now.toLocaleFormat("%l:%M %p");
Expand Down Expand Up @@ -189,7 +195,7 @@ MyApplet.prototype = {
if (this._calendarArea) this._calendarArea.unparent();
if (this.menu) this.menuManager.removeMenu(this.menu);

this.menu = new Applet.AppletPopupMenu(this, this._orientation);
this.menu = new Applet.AppletPopupMenu(this, this.orientation);
this.menuManager.addMenu(this.menu);

if (this._calendarArea){
Expand Down Expand Up @@ -220,12 +226,20 @@ MyApplet.prototype = {
}
}));
},

//
//override getDisplayLayout to declare that this applet is suitable for both horizontal and
// vertical orientations
//
getDisplayLayout: function() {
return Applet.DisplayLayout.BOTH;
},

on_orientation_changed: function (orientation) {
this._orientation = orientation;
this.orientation = orientation;
this._initContextMenu();
this.on_settings_changed();
}

};

function main(metadata, orientation, panel_height, instance_id) {
Expand Down
Expand Up @@ -92,7 +92,14 @@ MyApplet.prototype = {

on_applet_clicked: function(event) {
this.menu.toggle();
},
},
//
//override getDisplayLayout to declare that this applet is suitable for both horizontal and
// vertical orientations
//
getDisplayLayout: function() {
return Applet.DisplayLayout.BOTH;
},

_adjustGroupNames: function(names) {
// Disambiguate duplicate names with a subscript
Expand Down
23 changes: 20 additions & 3 deletions files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js
Expand Up @@ -1092,6 +1092,7 @@ MyApplet.prototype = {
this.menuManager = new PopupMenu.PopupMenuManager(this);
this.menu = new Applet.AppletPopupMenu(this, orientation);
this.menuManager.addMenu(this.menu);
this.orientation = orientation;

this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress));

Expand Down Expand Up @@ -1236,6 +1237,7 @@ MyApplet.prototype = {
},

on_orientation_changed: function (orientation) {
this.orientation = orientation;
this.menu.destroy();
this.menu = new Applet.AppletPopupMenu(this, orientation);
this.menuManager.addMenu(this.menu);
Expand All @@ -1246,6 +1248,15 @@ MyApplet.prototype = {

if (this.initial_load_done)
this._refreshAll();
this._updateIconAndLabel();
},

//
//override getDisplayLayout to declare that this applet is suitable for both horizontal and
// vertical orientations
//
getDisplayLayout: function() {
return Applet.DisplayLayout.BOTH;
},

on_applet_added_to_panel: function () {
Expand Down Expand Up @@ -1378,10 +1389,16 @@ MyApplet.prototype = {
this._applet_icon_box.show();
}

if (this.menuLabel != "")
this.set_applet_label(_(this.menuLabel));
else
if (this.orientation == St.Side.LEFT || this.orientation == St.Side.RIGHT) // no menu label if in a vertical panel
{
this.set_applet_label("");
}
else {
if (this.menuLabel != "")
this.set_applet_label(_(this.menuLabel));
else
this.set_applet_label("");
}
},

_onMenuKeyPress: function(actor, event) {
Expand Down
Expand Up @@ -242,6 +242,14 @@ MyApplet.prototype = {
this._display();
},

//
//override getDisplayLayout to declare that this applet is suitable for both horizontal and
// vertical orientations
//
getDisplayLayout: function() {
return Applet.DisplayLayout.BOTH;
},

on_applet_clicked: function(event) {
this._update_timestamp();
this.menu.toggle();
Expand Down

0 comments on commit 86e14ef

Please sign in to comment.