Skip to content

Commit 40058e6

Browse files
author
SkyzohKey
committed
Improve overall UX while using Ricin with native themes only. It rocks!
1 parent 8b42fda commit 40058e6

12 files changed

Lines changed: 631 additions & 620 deletions

res/ricin.desktop.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[Desktop Entry]
22
Name=Ricin
33
Comment=A dead-simple but powerful Tox client.
4-
Categories=Network
4+
Categories=Network;InstantMessaging;P2P;
55
Encoding=UTF-8
66
Exec=Ricin
77
Icon=ricin.svg
88
Type=Application
99
Terminal=false
1010
X-UserData=$CONFIG/ricin;
11+
MimeType=x-scheme-handler/tox;

res/ricin.gresource.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<file preprocess="xml-stripblanks" compressed="true">ui/settings-view.ui</file>
1919
<file preprocess="xml-stripblanks" compressed="true">ui/welcome-view.ui</file>
2020

21+
<file compressed="true">themes/styles.css</file>
2122
<file compressed="true">themes/app.css</file>
2223
<file compressed="true">themes/clearer.css</file>
2324
<file compressed="true">themes/dark.css</file>

res/themes/app.css

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@
77
/** GTK reset **/
88
@import url("reset.css");
99

10-
.badge {
11-
background-color: @ui_system_color;
12-
color: #ffffff;
13-
border-radius: 0px;
14-
padding: 3px 5px;
15-
font-size: 7px;
16-
}
17-
*:link {
18-
color: @ui_system_color;
19-
}
20-
2110
GtkEntry,
2211
GtkEntry:focus,
2312
GtkComboBox,

res/themes/styles.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@define-color blue_primary #2a92c6;
2+
3+
@define-color badge_color @blue_primary;
4+
@define-color links_color @blue_primary;
5+
6+
.badge {
7+
background-color: @badge_color;
8+
color: #ffffff;
9+
border-radius: 0px;
10+
padding: 3px 5px;
11+
font-size: 7px;
12+
}
13+
14+
*:link {
15+
color: @link_color;
16+
}
17+
18+
.box-search GtkSearchEntry,
19+
.box-search GtkToggleButton {
20+
border-radius: 0;
21+
}
22+

res/ui/chat-view.ui

Lines changed: 230 additions & 264 deletions
Large diffs are not rendered by default.

res/ui/file-list-row.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
</child>
248248
<style>
249249
<class name="image-desc"/>
250+
<class name="background"/>
250251
</style>
251252
</object>
252253
<packing>

res/ui/main-window.ui

Lines changed: 349 additions & 328 deletions
Large diffs are not rendered by default.

res/ui/settings-view.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</child>
2424
<style>
2525
<class name="notebook-buttons"/>
26+
<class name="background"/>
2627
</style>
2728
</object>
2829
<packing>

src/ChatView.vala

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ class Ricin.ChatView : Gtk.Box {
119119

120120
var _avatar_path = Tox.profile_dir () + "avatars/" + this.fr.pubkey + ".png";
121121
if (FileUtils.test (_avatar_path, FileTest.EXISTS)) {
122-
var pixbuf = new Gdk.Pixbuf.from_file_at_scale (_avatar_path, 48, 48, false);
123-
this.user_avatar.pixbuf = pixbuf;
122+
var pixbuf_scaled = new Gdk.Pixbuf.from_file_at_scale (_avatar_path, 48, 48, false);
123+
var pixbuf = new Gdk.Pixbuf.from_file_at_scale (_avatar_path, 128, 128, false);
124+
125+
this.user_avatar.pixbuf = pixbuf_scaled;
124126
this.friend_profil_avatar.pixbuf = pixbuf;
125127
} else {
126128
Cairo.Surface surface = Util.identicon_for_pubkey (this.fr.pubkey);
127-
var pixbuf = Gdk.pixbuf_get_from_surface (surface, 0, 0, 48, 48);
128-
this.user_avatar.pixbuf = pixbuf;
129-
this.friend_profil_avatar.pixbuf = pixbuf;
129+
var pixbuf_scaled = Gdk.pixbuf_get_from_surface (surface, 0, 0, 48, 48);
130+
this.user_avatar.pixbuf = pixbuf_scaled;
131+
this.friend_profil_avatar.pixbuf = Util.pubkey_to_image(this.fr.pubkey, 128, 128);
130132
}
131133

132134
this.entry.key_press_event.connect ((event) => {
@@ -223,7 +225,8 @@ class Ricin.ChatView : Gtk.Box {
223225

224226
fr.avatar.connect (p => {
225227
this.user_avatar.pixbuf = p;
226-
this.friend_profil_avatar.pixbuf = p;
228+
//this.friend_profil_avatar.pixbuf = p;
229+
this.friend_profil_avatar.pixbuf = Util.pubkey_to_image(this.fr.pubkey, 128, 128);
227230

228231
this.label_friend_last_seen.set_markup (this.fr.last_online ("%H:%M %d/%m/%Y"));
229232
});
@@ -245,7 +248,7 @@ class Ricin.ChatView : Gtk.Box {
245248
}
246249
} else {
247250
if (this.handle.status != Tox.UserStatus.BUSY) {
248-
Notification.notify (this.fr.name, message, 5000);
251+
Notification.notify (this.fr.name, message, 5000, Util.pubkey_to_image (this.fr.pubkey, 46, 46));
249252
}
250253
}
251254
}
@@ -281,7 +284,7 @@ class Ricin.ChatView : Gtk.Box {
281284
}
282285
} else {
283286
if (this.handle.status != Tox.UserStatus.BUSY) {
284-
Notification.notify (fr.name, message, 5000);
287+
Notification.notify (fr.name, message, 5000, Util.pubkey_to_image (this.fr.pubkey, 46, 46));
285288
}
286289
}
287290

src/EditableLabel.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public class Ricin.EditableLabel : Gtk.EventBox {
7070

7171
this.entry.get_style_context ().add_class ("entry-principal");
7272
this.button_ok.get_style_context ().add_class ("button-dark");
73-
this.button_ok.relief = Gtk.ReliefStyle.NONE;
73+
this.button_ok.relief = Gtk.ReliefStyle.NORMAL;
7474
this.button_cancel.get_style_context ().add_class ("button-dark");
75-
this.button_cancel.relief = Gtk.ReliefStyle.NONE;
75+
this.button_cancel.relief = Gtk.ReliefStyle.NORMAL;
7676

77-
this.entry.has_frame = false;
77+
this.entry.has_frame = true;
7878
this.entry.width_chars = 10;
7979

8080
this.button_ok.add (new Gtk.Image.from_icon_name ("object-select-symbolic", Gtk.IconSize.BUTTON));

0 commit comments

Comments
 (0)