mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
adjusted dialog parameters
This commit is contained in:
parent
211cf2ee9f
commit
6bf3c86068
@ -2971,25 +2971,33 @@ class PlaylistSettings(Gtk.Box):
|
|||||||
|
|
||||||
class SettingsDialog(Gtk.Dialog):
|
class SettingsDialog(Gtk.Dialog):
|
||||||
def __init__(self, parent, settings):
|
def __init__(self, parent, settings):
|
||||||
Gtk.Dialog.__init__(self, title=_("Settings"), transient_for=parent)
|
use_csd=settings.get_boolean("use-csd")
|
||||||
self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
|
if use_csd:
|
||||||
|
Gtk.Dialog.__init__(self, title=_("Settings"), transient_for=parent, use_header_bar=True)
|
||||||
|
# css
|
||||||
|
style_context=self.get_style_context()
|
||||||
|
provider=Gtk.CssProvider()
|
||||||
|
css=b"""* {-GtkDialog-content-area-border: 0px;}"""
|
||||||
|
provider.load_from_data(css)
|
||||||
|
style_context.add_provider(provider, 800)
|
||||||
|
else:
|
||||||
|
Gtk.Dialog.__init__(self, title=_("Settings"), transient_for=parent)
|
||||||
|
self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
|
||||||
self.set_default_size(500, 400)
|
self.set_default_size(500, 400)
|
||||||
|
|
||||||
# adding vars
|
|
||||||
self.settings=settings
|
|
||||||
|
|
||||||
# widgets
|
# widgets
|
||||||
general=GeneralSettings(self.settings)
|
general=GeneralSettings(settings)
|
||||||
profiles=ProfileSettings(parent, self.settings)
|
profiles=ProfileSettings(parent, settings)
|
||||||
playlist=PlaylistSettings(self.settings)
|
playlist=PlaylistSettings(settings)
|
||||||
|
|
||||||
# packing
|
# packing
|
||||||
tabs=Gtk.Notebook()
|
tabs=Gtk.Notebook()
|
||||||
tabs.append_page(general, Gtk.Label(label=_("General")))
|
tabs.append_page(general, Gtk.Label(label=_("General")))
|
||||||
tabs.append_page(profiles, Gtk.Label(label=_("Profiles")))
|
tabs.append_page(profiles, Gtk.Label(label=_("Profiles")))
|
||||||
tabs.append_page(playlist, Gtk.Label(label=_("Playlist")))
|
tabs.append_page(playlist, Gtk.Label(label=_("Playlist")))
|
||||||
self.vbox.pack_start(tabs, True, True, 0) # vbox default widget of dialogs
|
vbox=self.get_content_area()
|
||||||
self.vbox.set_spacing(3)
|
vbox.set_spacing(3)
|
||||||
|
vbox.pack_start(tabs, True, True, 0)
|
||||||
|
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
@ -3344,9 +3352,20 @@ class PlaybackOptions(Gtk.Box):
|
|||||||
#################
|
#################
|
||||||
|
|
||||||
class ServerStats(Gtk.Dialog):
|
class ServerStats(Gtk.Dialog):
|
||||||
def __init__(self, parent, client):
|
def __init__(self, parent, client, settings):
|
||||||
Gtk.Dialog.__init__(self, title=_("Stats"), transient_for=parent)
|
use_csd=settings.get_boolean("use-csd")
|
||||||
self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
|
if use_csd:
|
||||||
|
Gtk.Dialog.__init__(self, title=_("Stats"), transient_for=parent, use_header_bar=True)
|
||||||
|
# css
|
||||||
|
style_context=self.get_style_context()
|
||||||
|
provider=Gtk.CssProvider()
|
||||||
|
css=b"""* {-GtkDialog-content-area-border: 0px;}"""
|
||||||
|
provider.load_from_data(css)
|
||||||
|
style_context.add_provider(provider, 800)
|
||||||
|
else:
|
||||||
|
Gtk.Dialog.__init__(self, title=_("Stats"), transient_for=parent)
|
||||||
|
self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
|
||||||
|
self.set_resizable(False)
|
||||||
|
|
||||||
# adding vars
|
# adding vars
|
||||||
self.client=client
|
self.client=client
|
||||||
@ -3662,7 +3681,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
|||||||
|
|
||||||
def on_stats(self, action, param):
|
def on_stats(self, action, param):
|
||||||
if self.client.connected():
|
if self.client.connected():
|
||||||
stats=ServerStats(self, self.client)
|
stats=ServerStats(self, self.client, self.settings)
|
||||||
stats.destroy()
|
stats.destroy()
|
||||||
|
|
||||||
def on_update(self, action, param):
|
def on_update(self, action, param):
|
||||||
|
Loading…
Reference in New Issue
Block a user