Resurrect right-align button on the panel

The feature is in fact far more popular than one might think.
This commit is contained in:
Christian Dywan 2011-03-13 16:36:12 +01:00
parent 2722694639
commit fb681fac09
19 changed files with 108 additions and 74 deletions

View file

@ -30,6 +30,7 @@ struct _MidoriPanel
GtkWidget* labelbar; GtkWidget* labelbar;
GtkWidget* toolbar; GtkWidget* toolbar;
GtkToolItem* button_align;
GtkWidget* toolbar_label; GtkWidget* toolbar_label;
GtkWidget* frame; GtkWidget* frame;
GtkWidget* toolbook; GtkWidget* toolbook;
@ -209,8 +210,6 @@ midori_panel_class_init (MidoriPanelClass* class)
* Whether to align the panel on the right. * Whether to align the panel on the right.
* *
* Since: 0.1.3 * Since: 0.1.3
*
* Deprecated: 0.3.0
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_RIGHT_ALIGNED, PROP_RIGHT_ALIGNED,
@ -344,6 +343,13 @@ midori_panel_detach_page (MidoriPanel* panel,
gtk_widget_show (window); gtk_widget_show (window);
} }
static void
midori_panel_button_align_clicked_cb (GtkWidget* toolitem,
MidoriPanel* panel)
{
midori_panel_set_right_aligned (panel, !panel->right_aligned);
}
static void static void
midori_panel_destroy_cb (MidoriPanel* panel) midori_panel_destroy_cb (MidoriPanel* panel)
{ {
@ -386,6 +392,19 @@ midori_panel_init (MidoriPanel* panel)
gtk_container_add (GTK_CONTAINER (toolitem), panel->toolbar_label); gtk_container_add (GTK_CONTAINER (toolitem), panel->toolbar_label);
gtk_container_set_border_width (GTK_CONTAINER (toolitem), 6); gtk_container_set_border_width (GTK_CONTAINER (toolitem), 6);
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1); gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem),
_("Align sidepanel to the right"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem),
_("Align sidepanel to the right"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_panel_button_align_clicked_cb), panel);
#if HAVE_OSX
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, 0);
#else
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
#endif
panel->button_align = toolitem;
toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); toolitem = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close panel")); gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close panel"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem), _("Close panel")); gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem), _("Close panel"));
@ -536,7 +555,15 @@ midori_panel_set_right_aligned (MidoriPanel* panel,
box = gtk_widget_get_parent (panel->toolbar); box = gtk_widget_get_parent (panel->toolbar);
gtk_box_reorder_child (GTK_BOX (box), panel->toolbar, gtk_box_reorder_child (GTK_BOX (box), panel->toolbar,
right_aligned ? -1 : 0); right_aligned ? -1 : 0);
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (panel->button_align),
right_aligned ? GTK_STOCK_GO_BACK : GTK_STOCK_GO_FORWARD);
panel->right_aligned = right_aligned; panel->right_aligned = right_aligned;
gtk_tool_button_set_label (GTK_TOOL_BUTTON (panel->button_align),
!panel->right_aligned ? _("Align sidepanel to the right")
: _("Align sidepanel to the left"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (panel->button_align),
!panel->right_aligned ? _("Align sidepanel to the right")
: _("Align sidepanel to the left"));
g_object_notify (G_OBJECT (panel), "right-aligned"); g_object_notify (G_OBJECT (panel), "right-aligned");
} }

View file

@ -2852,11 +2852,11 @@ msgstr "Empra el disc com a memòria cau de comunicacions HTTP"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Desenganxar el panell triat de la finestra" #~ msgstr "Desenganxar el panell triat de la finestra"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Alinear el panell lateral a la dreta" msgstr "Alinear el panell lateral a la dreta"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Alinear el panell lateral a l'esquerra" msgstr "Alinear el panell lateral a l'esquerra"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Oculta els controls d'operació" #~ msgstr "Oculta els controls d'operació"

View file

@ -2903,11 +2903,11 @@ msgstr "Kešuje (ukládá) HTTP komunikaci na disk"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Oddělit vybraný panel od okna" #~ msgstr "Oddělit vybraný panel od okna"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Umístit boční panel vpravo" msgstr "Umístit boční panel vpravo"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Umístit boční panel vlevo" msgstr "Umístit boční panel vlevo"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Schovat ovládací prvky" #~ msgstr "Schovat ovládací prvky"

View file

@ -2985,11 +2985,11 @@ msgstr "HTTP-Kommunikation auf der Festplatte zwischenspeichern"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Gewählte Leiste vom Fenster ablösen" #~ msgstr "Gewählte Leiste vom Fenster ablösen"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Seitenleiste rechts anordnen" msgstr "Seitenleiste rechts anordnen"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Seitenleiste links anordnen" msgstr "Seitenleiste links anordnen"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Bedienelemente anzeigen" #~ msgstr "Bedienelemente anzeigen"

View file

@ -2938,10 +2938,12 @@ msgstr "Προσωρινή μνήμη επικοινωνίας HTTP στο δί
#~ msgstr "Ελαχιστοποίηση της συγκεκριμένης καρτέλας" #~ msgstr "Ελαχιστοποίηση της συγκεκριμένης καρτέλας"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Αποσύνδεση επιλεγμένου πλαισίου από το παράθυρο" #~ msgstr "Αποσύνδεση επιλεγμένου πλαισίου από το παράθυρο"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα δεξιά" msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα δεξιά"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα αριστερά"
msgid "Align sidepanel to the left"
msgstr "Ευθυγράμμιση πλαϊνού πλαισίου στα αριστερά"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Απόκρυψη στοιχείων λειτουργίας" #~ msgstr "Απόκρυψη στοιχείων λειτουργίας"
#~ msgid "Spell Checking" #~ msgid "Spell Checking"

View file

@ -2970,11 +2970,11 @@ msgstr "Cachear tráfico HTTP en disco"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar el panel elegido de la ventana" #~ msgstr "Separar el panel elegido de la ventana"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Alinear el panel a la derecha" msgstr "Alinear el panel a la derecha"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Alinear el panel a la izquierda" msgstr "Alinear el panel a la izquierda"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Ocultar _controles de operación" #~ msgstr "Ocultar _controles de operación"

View file

@ -2856,11 +2856,11 @@ msgstr "Gardar unha caché da comunicación HTTP no disco"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar o panel seleccionado da xanela " #~ msgstr "Separar o panel seleccionado da xanela "
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Aliñar o panel lateral á dereita" msgstr "Aliñar o panel lateral á dereita"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Aliñar o panel lateral á esquerda" msgstr "Aliñar o panel lateral á esquerda"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Ocultar os controis de operación" #~ msgstr "Ocultar os controis de operación"

View file

@ -2899,11 +2899,11 @@ msgstr ""
#~ msgid "Minimize the current tab" #~ msgid "Minimize the current tab"
#~ msgstr "Minimiziraj trenutnu karticu" #~ msgstr "Minimiziraj trenutnu karticu"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Poravnaj bočni stupac desno" msgstr "Poravnaj bočni stupac desno"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Poravnaj bočni stupac lijevo" msgstr "Poravnaj bočni stupac lijevo"
#~ msgid "Spell Checking" #~ msgid "Spell Checking"
#~ msgstr "Provjera pravopisa" #~ msgstr "Provjera pravopisa"

View file

@ -2846,11 +2846,11 @@ msgstr "HTTP kommunikáció gyorsítótárazása a lemezen"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Kiválasztott panel leválasztása az ablakról" #~ msgstr "Kiválasztott panel leválasztása az ablakról"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Az oldalsáv jobbra igazítása" msgstr "Az oldalsáv jobbra igazítása"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Az oldalsáv balra igazítása" msgstr "Az oldalsáv balra igazítása"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Vezérlők elrejtése" #~ msgstr "Vezérlők elrejtése"

View file

@ -2900,11 +2900,11 @@ msgstr "Memorizza la comunicazione HTTP sul disco"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Stacca il pannello selezionato dalla finestra" #~ msgstr "Stacca il pannello selezionato dalla finestra"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Allinea il pannello laterale a destra" msgstr "Allinea il pannello laterale a destra"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Allinea il pannello laterale a sinistra" msgstr "Allinea il pannello laterale a sinistra"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Nasconde i controlli operativi" #~ msgstr "Nasconde i controlli operativi"

View file

@ -3133,12 +3133,12 @@ msgstr "HTTP 通信をディスクにキャッシュします"
#~ msgstr "選択したパネルをウィンドウから切り離します" #~ msgstr "選択したパネルをウィンドウから切り離します"
# tooltip # tooltip
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "サイドパネルを右側に配置します" msgstr "サイドパネルを右側に配置します"
# tooltip # tooltip
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "サイドパネルを左側に配置します" msgstr "サイドパネルを左側に配置します"
# tooltip # tooltip
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"

View file

@ -2923,11 +2923,11 @@ msgstr "디스크에 HTTP 통신을 저장합니다."
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "선택한 패널 창에서 분리" #~ msgstr "선택한 패널 창에서 분리"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "창을 오른쪽으로 이동" msgstr "창을 오른쪽으로 이동"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "창을 왼쪽으로 이동" msgstr "창을 왼쪽으로 이동"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "조작 컨트롤 감추기(_C)" #~ msgstr "조작 컨트롤 감추기(_C)"

View file

@ -3001,11 +3001,11 @@ msgstr "Przechowuje dane komunikacji HTTP na dysku"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Odłącza panel od okna" #~ msgstr "Odłącza panel od okna"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Umieszcza panel boczy po prawej stronie okna" msgstr "Umieszcza panel boczy po prawej stronie okna"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Umieszcza panel boczy po lewej stronie okna" msgstr "Umieszcza panel boczy po lewej stronie okna"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Przełącza widoczność przycisków konfiguracyjnych panelu" #~ msgstr "Przełącza widoczność przycisków konfiguracyjnych panelu"

View file

@ -2934,10 +2934,13 @@ msgstr "Pôr comunicações HTTP em cache"
#~ msgstr "Falha ao limpar o histórico de pesquisa: %s\n" #~ msgstr "Falha ao limpar o histórico de pesquisa: %s\n"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Separar da janela o painel escolhido" #~ msgstr "Separar da janela o painel escolhido"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Alinhar painel lateral à direita" msgstr "Alinhar painel lateral à direita"
#~ msgid "Align sidepanel to the left"
#~ msgstr "Alinhar painel lateral à esquerda"
msgid "Align sidepanel to the left"
msgstr "Alinhar painel lateral à esquerda"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Ocultar controles operacionais" #~ msgstr "Ocultar controles operacionais"
#~ msgid "Spell Checking" #~ msgid "Spell Checking"

View file

@ -2973,11 +2973,11 @@ msgstr "Кэширует принятые данные (HTTP) на диске"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Отсоединить выбранную панель от главного окна" #~ msgstr "Отсоединить выбранную панель от главного окна"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Расположить панель справа" msgstr "Расположить панель справа"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Расположить панель слева" msgstr "Расположить панель слева"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Скрыть элементы управления" #~ msgstr "Скрыть элементы управления"

View file

@ -2857,11 +2857,11 @@ msgstr "Diskteki HTTP iletişimi önbelleği"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Pencereden seçilmiş paneli ayır" #~ msgstr "Pencereden seçilmiş paneli ayır"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Kenar panelini sağa hizala" msgstr "Kenar panelini sağa hizala"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Kenar panelini sola hizala" msgstr "Kenar panelini sola hizala"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "İşlem kontrollerini gizle" #~ msgstr "İşlem kontrollerini gizle"

View file

@ -2908,11 +2908,11 @@ msgstr "Кешувати комунікацію HTTP на диск"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "Від’єднати вибрану панель від вікна" #~ msgstr "Від’єднати вибрану панель від вікна"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "Рівняти бічну панель по правому краю" msgstr "Рівняти бічну панель по правому краю"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "Рівняти бічну панель по лівому краю" msgstr "Рівняти бічну панель по лівому краю"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "Приховати панель _управління" #~ msgstr "Приховати панель _управління"

View file

@ -2908,11 +2908,11 @@ msgstr "在磁盘上缓存 HTTP 通讯"
#~ msgid "Detach chosen panel from the window" #~ msgid "Detach chosen panel from the window"
#~ msgstr "从窗口中分离选择的面板" #~ msgstr "从窗口中分离选择的面板"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "侧栏在右" msgstr "侧栏在右"
#~ msgid "Align sidepanel to the left" msgid "Align sidepanel to the left"
#~ msgstr "侧栏在左" msgstr "侧栏在左"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "隐藏操作控件" #~ msgstr "隐藏操作控件"

View file

@ -2923,10 +2923,12 @@ msgstr "對 HTTP 通訊製作一份硬碟快取"
#~ msgstr "傳輸列(_T)" #~ msgstr "傳輸列(_T)"
#~ msgid "Show transferbar" #~ msgid "Show transferbar"
#~ msgstr "顯示傳輸列" #~ msgstr "顯示傳輸列"
#~ msgid "Align sidepanel to the right" msgid "Align sidepanel to the right"
#~ msgstr "側面板靠右對齊" msgstr "側面板靠右對齊"
#~ msgid "Align sidepanel to the left"
#~ msgstr "側面板靠左對齊"
msgid "Align sidepanel to the left"
msgstr "側面板靠左對齊"
#~ msgid "Hide operating controls" #~ msgid "Hide operating controls"
#~ msgstr "隱藏操作控制項" #~ msgstr "隱藏操作控制項"
#~ msgid "Show progress in location entry" #~ msgid "Show progress in location entry"