Replace social section by icons in bottom

merge-requests/64/head
Huluti 2016-12-05 18:41:28 +01:00
parent 42abef2e45
commit a1a1daa2dc
6 changed files with 140 additions and 96 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
src/img/google+.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

BIN
src/img/reddit.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/img/twitter.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

View File

@ -94,7 +94,7 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">4</property> <property name="width">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -110,7 +110,7 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">4</property> <property name="width">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -128,7 +128,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">2</property> <property name="top_attach">2</property>
<property name="width">4</property> <property name="width">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -173,20 +173,6 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="top_attach">3</property> <property name="top_attach">3</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">SOCIAL</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">3</property>
</packing>
</child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton">
<property name="label" translatable="yes">Read me</property> <property name="label" translatable="yes">Read me</property>
@ -314,91 +300,137 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLinkButton"> <object class="GtkBox">
<property name="label" translatable="yes">Google+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://plus.google.com/118244873957924966264</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLinkButton">
<property name="label" translatable="yes">Facebook</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://www.facebook.com/ManjaroLinux</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLinkButton">
<property name="label" translatable="yes">Twitter</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://twitter.com/ManjaroLinux</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLinkButton">
<property name="label" translatable="yes">Reddit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://www.reddit.com/r/ManjaroLinux/</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">end</property> <property name="valign">end</property>
<property name="label" translatable="yes">Launch at start</property> <property name="vexpand">True</property>
<property name="spacing">10</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkEventBox">
<property name="name">google+</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/google+.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEventBox">
<property name="name">facebook</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/facebook.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEventBox">
<property name="name">twitter</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/twitter.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkEventBox">
<property name="name">reddit</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/reddit.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Launch at start</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="autostart">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<signal name="notify::active" handler="on_autostart_switched" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">0</property>
<property name="top_attach">8</property> <property name="top_attach">8</property>
<property name="width">3</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkSwitch" id="autostart">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<signal name="notify::active" handler="on_autostart_switched" swapped="no"/>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>

View File

@ -4,8 +4,9 @@ import locale
import gettext import gettext
import os import os
import json import json
import gi
import shutil import shutil
import webbrowser
import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk
@ -31,6 +32,14 @@ class ManjaroHello(Gtk.Window):
self.infos = get_infos() self.infos = get_infos()
# Social urls
self.social_urls = {
"google+": "https://plus.google.com/118244873957924966264",
"facebook": "https://www.facebook.com/ManjaroLinux",
"twitter": "https://twitter.com/ManjaroLinux",
"reddit": "https://www.reddit.com/r/ManjaroLinux"
}
# Init language # Init language
locale.setlocale(locale.LC_ALL, "") locale.setlocale(locale.LC_ALL, "")
locale.bindtextdomain(self.app, self.locale_dir) locale.bindtextdomain(self.app, self.locale_dir)
@ -115,6 +124,9 @@ class ManjaroHello(Gtk.Window):
self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("project"))
self.builder.get_object("project").set_current_page(0) self.builder.get_object("project").set_current_page(0)
def on_social_pressed(self, eventbox, _):
webbrowser.open_new_tab(self.social_urls[eventbox.get_name()])
def on_autostart_switched(self, switch, _): def on_autostart_switched(self, switch, _):
autostart = True if switch.get_active() else False autostart = True if switch.get_active() else False
self.change_autostart(autostart) self.change_autostart(autostart)