Commit e3066fb5 authored by Philipp Hörist's avatar Philipp Hörist Committed by Philipp Hörist

Improve AccountsWindow design

Fixes #8940
parent e93ab408
This diff is collapsed.
......@@ -1244,6 +1244,11 @@ def get_accounts_info():
'show': status, 'message': message})
return accounts
def get_current_show(account):
if account not in app.connections:
return 'offline'
status = app.connections[account].connected
return app.SHOW_LIST[status]
def get_iconset_path(iconset):
if os.path.isdir(os.path.join(app.DATA_DIR, 'iconsets', iconset)):
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.21.0 -->
<interface>
<requires lib="gtk+" version="3.18"/>
<object class="GtkBox" id="box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="stack">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="notify::visible-child-name" handler="on_child_visible" swapped="no"/>
<property name="halign">start</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="account_page">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="max_content_height">400</property>
<property name="propagate_natural_height">True</property>
<child>
<object class="GtkScrolledWindow">
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="max_content_height">400</property>
<property name="propagate_natural_height">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkViewport">
<object class="GtkListBox" id="account_list">
<property name="name">OptionsBox1</property>
<property name="width_request">170</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="account_list">
<property name="name">OptionsBox</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="on_row_activated" swapped="no"/>
</object>
</child>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="vexpand">True</property>
<signal name="row-activated" handler="on_row_activated" swapped="no"/>
<style>
<class name="account-list"/>
</style>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkActionBar" id="actionbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="name">main</property>
<property name="title">page0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
......@@ -71,42 +58,21 @@
<property name="position">0</property>
</packing>
</child>
</object>
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Accounts</property>
<property name="show_close_button">True</property>
<property name="decoration_layout">:close</property>
<child>
<object class="GtkButton" id="back_button">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<signal name="clicked" handler="on_back_button" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuButton" id="menu_button">
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hhomogeneous">False</property>
<property name="vhomogeneous">False</property>
<signal name="notify::visible-child-name" handler="on_child_visible" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
......
......@@ -75,16 +75,13 @@ popover#EmoticonPopover flowboxchild { padding-top: 5px; padding-bottom: 5px; }
.PopoverButtonListbox > list > row.activatable:active { box-shadow: none; background-color: @theme_selected_bg_color }
/* Accounts Window */
#AccountsWindow > box { padding:30px 30px 30px 30px;}
#AccountsWindow > box > stack { padding:30px 30px 30px 30px;}
#AccountsWindow scrolledwindow {border: none;}
#AccountsWindow list {border: 1px solid; border-color: @borders;}
#AccountsWindow > box actionbar box {border: none;}
#AccountNameEntry:disabled { font-size: 16px;
font-weight: bold;
border: none;
background-color: @theme_unfocused_bg_color;
color: @theme_text_color; }
#AccountsWindow stack list {border: 1px solid; border-color: @borders;}
#AccountsWindow > box > box { border-right: 1px solid; border-color: @borders; }
.account-list > row { padding: 20px 20px 20px 10px; }
/* StartChatListBox */
#StartChatListBox > row { border-bottom: 1px solid; border-color: @theme_unfocused_bg_color; }
......
......@@ -239,7 +239,12 @@ class SwitchOption(GenericOption):
GenericOption.__init__(self, *args)
self.switch = Gtk.Switch()
self.switch.set_active(self.option_value)
if self.type_ == OptionType.ACTION:
self.switch.set_action_name('app.%s' % self.option_value)
state = app.app.get_action_state(self.option_value)
self.switch.set_active(state.get_boolean())
else:
self.switch.set_active(self.option_value)
self.switch.connect('notify::active', self.on_switch)
self.switch.set_hexpand(True)
self.switch.set_halign(Gtk.Align.END)
......@@ -271,6 +276,7 @@ class EntryOption(GenericOption):
self.entry.set_text(str(self.option_value))
self.entry.connect('notify::text', self.on_text_change)
self.entry.set_valign(Gtk.Align.CENTER)
self.entry.set_alignment(1)
if self.value == 'password':
self.entry.set_invisible_char('*')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment