Skip to content

Commit

Permalink
#1702: don't modify window background color and move common window se…
Browse files Browse the repository at this point in the history
…tup code to gtk_util

git-svn-id: https://xpra.org/svn/Xpra/trunk@17834 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 3, 2018
1 parent 2db6676 commit f7b78b7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
7 changes: 3 additions & 4 deletions src/xpra/client/gtk_base/bug_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
gdk = import_gdk()
pango = import_pango()

from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, get_display_info, get_default_root_window, \
from xpra.gtk_common.gtk_util import window_defaults, gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, get_display_info, get_default_root_window, \
JUSTIFY_LEFT, WIN_POS_CENTER, STATE_NORMAL, FILE_CHOOSER_ACTION_SAVE, choose_file, get_gtk_version_info
from xpra.util import nonl, envint, repr_ellipsized
from xpra.os_util import strtobytes
Expand All @@ -39,11 +39,10 @@ def init(self, show_about=True, get_server_info=None, opengl_info=None, includes

def setup_window(self):
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.close)
self.window.set_default_size(400, 300)
self.window.set_border_width(20)
self.window.set_title("Xpra Bug Report")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

icon_pixbuf = self.get_icon("bugs.png")
if icon_pixbuf:
Expand Down Expand Up @@ -89,7 +88,7 @@ def setup_window(self):
self.description.set_justification(JUSTIFY_LEFT)
self.description.set_border_width(2)
self.description.set_size_request(300, 80)
self.description.modify_bg(STATE_NORMAL, gdk.Color(red=32768, green=32768, blue=32768))
#self.description.modify_bg(STATE_NORMAL, gdk.Color(red=32768, green=32768, blue=32768))
ibox.pack_start(self.description, expand=False, fill=False)

# Toggles:
Expand Down
5 changes: 2 additions & 3 deletions src/xpra/client/gtk_base/client_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from xpra.scripts.config import read_config, make_defaults_struct, validate_config, save_config
from xpra.codecs.loader import PREFERED_ENCODING_ORDER
from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, color_parse, \
OptionMenu, choose_file, set_use_tray_workaround, \
OptionMenu, choose_file, set_use_tray_workaround, window_defaults, \
WIN_POS_CENTER, STATE_NORMAL, \
DIALOG_DESTROY_WITH_PARENT, MESSAGE_INFO, BUTTONS_CLOSE, \
FILE_CHOOSER_ACTION_SAVE, FILE_CHOOSER_ACTION_OPEN
Expand Down Expand Up @@ -161,11 +161,10 @@ def image_button(self, label="", tooltip="", icon_pixbuf=None, clicked_cb=None):

def create_window(self):
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.destroy)
self.window.set_default_size(400, 260)
self.window.set_border_width(20)
self.window.set_title("Xpra Launcher")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

self.window.set_position(WIN_POS_CENTER)

Expand Down
5 changes: 2 additions & 3 deletions src/xpra/client/gtk_base/open_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from xpra.os_util import monotonic_time, bytestostr
from xpra.simple_stats import std_unit_dec
from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, \
TableBuilder, WIN_POS_CENTER, STATE_NORMAL
TableBuilder, WIN_POS_CENTER, window_defaults
from xpra.platform.paths import get_icon_dir
from xpra.log import Logger, enable_debug_for
log = Logger("util")
Expand All @@ -46,11 +46,10 @@ def __init__(self, show_file_upload_cb=None):
self.requests = []
self.expire_labels = {}
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.close)
self.window.set_default_size(400, 150)
self.window.set_border_width(20)
self.window.set_title("Transfers")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

icon_pixbuf = self.get_icon("download.png")
if icon_pixbuf:
Expand Down
5 changes: 2 additions & 3 deletions src/xpra/client/gtk_base/server_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from xpra.os_util import monotonic_time
from xpra.util import AdHocStruct, typedict
from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, \
get_pixbuf_from_data, TableBuilder, WIN_POS_CENTER, STATE_NORMAL
get_pixbuf_from_data, window_defaults, TableBuilder, WIN_POS_CENTER
from xpra.platform.paths import get_icon_dir
from xpra.log import Logger, enable_debug_for
log = Logger("util")
Expand All @@ -46,11 +46,10 @@ def __init__(self, client):
self.commands_info = {}
self.table = None
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.close)
self.window.set_default_size(400, 150)
self.window.set_border_width(20)
self.window.set_title("Server Commands")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

icon_pixbuf = self.get_icon("list.png")
if icon_pixbuf:
Expand Down
7 changes: 3 additions & 4 deletions src/xpra/client/gtk_base/start_new_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
pango = import_pango()


from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, \
WIN_POS_CENTER, STATE_NORMAL
from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, window_defaults, \
WIN_POS_CENTER
from xpra.platform.paths import get_icon_dir
from xpra.log import Logger, enable_debug_for
log = Logger("util")
Expand All @@ -41,11 +41,10 @@ class StartNewCommand(object):
def __init__(self, run_callback=None, can_share=False):
self.run_callback = run_callback
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.close)
self.window.set_default_size(400, 150)
self.window.set_border_width(20)
self.window.set_title("Start New Command")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

icon_pixbuf = self.get_icon("forward.png")
if icon_pixbuf:
Expand Down
7 changes: 3 additions & 4 deletions src/xpra/client/gtk_base/update_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
glib = import_glib()


from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, \
WIN_POS_CENTER, STATE_NORMAL
from xpra.gtk_common.gtk_util import gtk_main, add_close_accel, scaled_image, pixbuf_new_from_file, window_defaults, \
WIN_POS_CENTER
from xpra.platform.paths import get_icon_dir
from xpra.log import Logger, enable_debug_for
log = Logger("util")
Expand All @@ -39,11 +39,10 @@ class UpdateStatusWindow(object):

def __init__(self):
self.window = gtk.Window()
window_defaults(self.window)
self.window.connect("destroy", self.close)
self.window.set_default_size(400, 200)
self.window.set_border_width(20)
self.window.set_title("Xpra Version Check")
self.window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))

icon = self.get_icon("update.png")
if icon:
Expand Down
4 changes: 4 additions & 0 deletions src/xpra/gtk_common/gtk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,10 @@ def title_box(label_str):
return eb


def window_defaults(window):
window.set_border_width(20)
#window.modify_bg(STATE_NORMAL, gdk.Color(red=65535, green=65535, blue=65535))


#utility method to ensure there is always only one CheckMenuItem
#selected in a submenu:
Expand Down

0 comments on commit f7b78b7

Please sign in to comment.