Replace social section by icons in bottom

This commit is contained in:
Huluti 2016-12-05 18:41:28 +01:00
parent 42abef2e45
commit a1a1daa2dc
6 changed files with 140 additions and 96 deletions

BIN
src/img/facebook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
src/img/google+.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

BIN
src/img/reddit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/img/twitter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

View File

@ -94,7 +94,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">4</property>
<property name="width">3</property>
</packing>
</child>
<child>
@ -110,7 +110,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">4</property>
<property name="width">3</property>
</packing>
</child>
<child>
@ -128,7 +128,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">4</property>
<property name="width">3</property>
</packing>
</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>
</packing>
</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>
<object class="GtkButton">
<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>
</child>
<child>
<object class="GtkLinkButton">
<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">
<object class="GtkBox">
<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>
<property name="valign">end</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>
<packing>
<property name="left_attach">2</property>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="width">3</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="left_attach">3</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>

View File

@ -4,8 +4,9 @@ import locale
import gettext
import os
import json
import gi
import shutil
import webbrowser
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
@ -31,6 +32,14 @@ class ManjaroHello(Gtk.Window):
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
locale.setlocale(locale.LC_ALL, "")
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("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, _):
autostart = True if switch.get_active() else False
self.change_autostart(autostart)