Skip to content

Commit

Permalink
#2678 / #2762 try to make header bar smaller
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@26368 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 17, 2020
1 parent 6317761 commit d23dd95
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/css/10_header_bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* This file is part of Xpra.
* Copyright (C) 2020 Antoine Martin <[email protected]>
* Xpra is released under the terms of the GNU GPL v2, or, at your option, any
* later version. See the file COPYING for details.
*
* Try to make the header bar use less vertical space
* (why is it so hard?)
*/

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
margin-top: 0px; /* same as headerbar side padding for nicer proportions */
margin-bottom: 0px;
}

headerbar {
min-height: 24px;
padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
padding-right: 2px;
margin: 0px; /* same as headerbar side padding for nicer proportions */
padding: 0px;
}
12 changes: 10 additions & 2 deletions src/xpra/client/gtk_base/gtk_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from xpra.client.ui_client_base import UIXpraClient
from xpra.client.gobject_client_base import GObjectXpraClient
from xpra.client.gtk_base.gtk_keyboard_helper import GTKKeyboardHelper
from xpra.client.gtk_base.css_overrides import inject_css_overrides
from xpra.client.mixins.window_manager import WindowClient
from xpra.platform.paths import get_icon_filename
from xpra.platform.gui import (
Expand Down Expand Up @@ -66,6 +67,8 @@
NO_OPENGL_WINDOW_TYPES = os.environ.get("XPRA_NO_OPENGL_WINDOW_TYPES",
"DOCK,TOOLBAR,MENU,UTILITY,SPLASH,DROPDOWN_MENU,POPUP_MENU,TOOLTIP,NOTIFICATION,COMBO,DND").split(",")

inject_css_overrides()


class GTKXpraClient(GObjectXpraClient, UIXpraClient):
__gsignals__ = {}
Expand Down Expand Up @@ -393,7 +396,7 @@ def rec_answer(accept, newopenit=openit):
#record our response, so we will accept the file
self.data_send_requests[send_id] = (dtype, url, printit, newopenit)
cb_answer(accept)
self.file_ask_dialog = getOpenRequestsWindow(self.show_file_upload)
self.file_ask_dialog = getOpenRequestsWindow(self.show_file_upload, self.cancel_download)
self.file_ask_dialog.add_request(rec_answer, send_id, dtype, url, filesize, printit, openit, timeout)
self.file_ask_dialog.show()

Expand All @@ -405,9 +408,14 @@ def close_ask_data_dialog(self):

def show_ask_data_dialog(self, *_args):
from xpra.client.gtk_base.open_requests import getOpenRequestsWindow
self.file_ask_dialog = getOpenRequestsWindow(self.show_file_upload)
self.file_ask_dialog = getOpenRequestsWindow(self.show_file_upload, self.cancel_download)
self.file_ask_dialog.show()

def transfer_progress_update(self, send=True, transfer_id=0, elapsed=0, position=0, total=0, error=None):
fad = self.file_ask_dialog
if fad:
self.idle_add(fad.transfer_progress_update, send, transfer_id, elapsed, position, total, error)


def accept_data(self, send_id, dtype, url, printit, openit):
#check if we have accepted this file via the GUI:
Expand Down

0 comments on commit d23dd95

Please sign in to comment.