Display user status online/offline with circles (#40)
Adds a display of the user's offline/online status through red and green circles, respectively.
This commit is contained in:
parent
02759c59f7
commit
ffacf70a4f
|
@ -49,6 +49,7 @@ set(RESOURCE_LIST
|
|||
icons/scalable/status/dino-status-chat.svg
|
||||
icons/scalable/status/dino-status-dnd.svg
|
||||
icons/scalable/status/dino-status-online.svg
|
||||
icons/scalable/status/dino-status-offline.svg
|
||||
icons/scalable/status/dino-tick-symbolic.svg
|
||||
icons/scalable/status/dino-video-off-symbolic.svg
|
||||
icons/scalable/status/dino-video-symbolic.svg
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
<file>icons/scalable/status/dino-status-chat.svg</file>
|
||||
<file>icons/scalable/status/dino-status-dnd.svg</file>
|
||||
<file>icons/scalable/status/dino-status-online.svg</file>
|
||||
<file>icons/scalable/status/dino-status-offline.svg</file>
|
||||
<file>icons/scalable/status/dino-tick-symbolic.svg</file>
|
||||
<file>icons/scalable/status/dino-video-off-symbolic.svg</file>
|
||||
<file>icons/scalable/status/dino-video-symbolic.svg</file>
|
||||
|
|
11
main/data/icons/scalable/status/dino-status-offline.svg
Normal file
11
main/data/icons/scalable/status/dino-status-offline.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<svg width="99.999997" height="99.999997" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" version="1.1">
|
||||
|
||||
<g class="layer">
|
||||
<title>Layer 1</title>
|
||||
<g id="svg_1">
|
||||
<circle cx="50" cy="51" fill="#ff0000" fill-rule="evenodd" id="svg_2" r="50" stroke="#ff0000"/>
|
||||
<path d="m20,51l60,0" fill="#ff0000" id="svg_3" stroke="#ff0000" stroke-linecap="round" stroke-width="15"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 444 B |
|
@ -15,7 +15,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="name_label">
|
||||
<property name="max_width_chars">1</property>
|
||||
<property name="width-chars">20</property>
|
||||
<property name="max-width-chars">40</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="xalign">0</property>
|
||||
|
@ -26,11 +27,8 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="status_label">
|
||||
<property name="max_width_chars">1</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<object class="GtkImage" id="status_image">
|
||||
<property name="pixel-size">12</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
|
|
|
@ -10,10 +10,7 @@ public class ListRow : Object {
|
|||
private Grid main_grid;
|
||||
private AvatarPicture picture;
|
||||
public Label name_label;
|
||||
|
||||
// TODO: use something more visual for status
|
||||
public Label status;
|
||||
|
||||
public Image status_image;
|
||||
public Conversation? conversation;
|
||||
public Jid? jid;
|
||||
|
||||
|
@ -22,8 +19,10 @@ public class ListRow : Object {
|
|||
main_grid = (Grid) builder.get_object("main_grid");
|
||||
picture = (AvatarPicture) builder.get_object("picture");
|
||||
name_label = (Label) builder.get_object("name_label");
|
||||
status = (Label) builder.get_object("status_label");
|
||||
status.label = "(unknown)";
|
||||
status_image = (Image) builder.get_object("status_image");
|
||||
main_grid.set_column_spacing(10);
|
||||
main_grid.set_column_homogeneous(false);
|
||||
main_grid.set_baseline_row(1);
|
||||
}
|
||||
|
||||
public ListRow(StreamInteractor stream_interactor, Conversation conversation, Jid jid) {
|
||||
|
@ -44,11 +43,11 @@ public class ListRow : Object {
|
|||
}
|
||||
|
||||
public void set_online() {
|
||||
status.label = ("");
|
||||
status_image.icon_name = "dino-status-online";
|
||||
}
|
||||
|
||||
public void set_offline() {
|
||||
status.label = ("(offline)");
|
||||
status_image.icon_name = "dino-status-offline";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue