Skip to content
Permalink
Browse files

rework float menu sizing

  • Loading branch information
mjharkin committed Apr 25, 2019
1 parent ae69e1f commit fe6b046ae912081a7e4d3e1d109aa2c2842475fc
Showing with 11 additions and 7 deletions.
  1. +1 −1 trunk/src/html5/css/menu-skin.css
  2. +8 −3 trunk/src/html5/index.html
  3. +2 −3 trunk/src/html5/js/Client.js
@@ -26,7 +26,7 @@ SOFTWARE.
#float_menu {
display: inline-block;
height: 30px;
padding: 0px 0px 0px 10px;
padding: 0px 0px 0px 20px;
z-index: 100000;
background: repeating-linear-gradient(
90deg,
@@ -239,9 +239,9 @@ <h2>Xpra Bug Report</h2>
<script>
var getparam = Utilities.getparam;
var getboolparam = Utilities.getboolparam;
var float_menu_width = 130;
var float_menu_item_size = 30;
var float_menu_padding = 10;
var float_menu_padding = 20;
var float_menu_width = (float_menu_item_size*4) + float_menu_padding;

// disable right click menu:
window.oncontextmenu = function(e) {
@@ -901,7 +901,12 @@ <h2>Xpra Bug Report</h2>
}

function expand_float_menu(){
document.getElementById('float_menu').style.width=float_menu_width-10+'px'; $('#float_menu').children().show();
var expanded_width = (float_menu_item_size*4);
document.getElementById('float_menu').style.width= expanded_width +'px';
if(client){
client.reconfigure_all_trays();
}
$('#float_menu').children().show();
}

function retract_float_menu(){
@@ -2087,12 +2087,11 @@ XpraClient.prototype._tray_closed = function(win) {

XpraClient.prototype.reconfigure_all_trays = function() {
var float_menu = document.getElementById("float_menu");
// default width 4x30 (icons) + 10 (padding)
float_menu_width = 130;
float_menu_width = (float_menu_item_size*4) + float_menu_padding;
for (var twid in this.id_to_window) {
var twin = this.id_to_window[twid];
if (twin && twin.tray) {
float_menu_width = float_menu_width + 30;
float_menu_width = float_menu_width + float_menu_item_size;
this.send_tray_configure(twid);
}
}

0 comments on commit fe6b046

Please sign in to comment.
You can’t perform that action at this time.