1
0
mirror of https://gitlab.gnome.org/World/tootle synced 2025-02-13 01:50:37 +01:00
This commit is contained in:
Bleak Grey 2020-10-24 06:42:24 +03:00
parent 6cf3bbafd0
commit 4e7c6ad225
6 changed files with 30 additions and 30 deletions

View File

@ -5,13 +5,13 @@
} }
.attachment { .attachment {
border-radius: 6px; border-radius: 5px;
background: rgba (150, 150, 150, 0.2); background: rgba (150, 150, 150, 0.2);
padding:0px; padding:0px;
margin:0px; margin:0px;
} }
.attachment .pic { .attachment .pic {
border-radius: 6px; border-radius: 5px;
} }
.attachment .chip { .attachment .chip {
padding: 6px; padding: 6px;
@ -36,6 +36,7 @@
box-shadow: none; box-shadow: none;
} }
.ttl-avatar-button { .ttl-flat-button {
padding: 0; padding: 0px;
margin: 0px;
} }

View File

@ -43,7 +43,7 @@
<class name="flat"/> <class name="flat"/>
<class name="image-button"/> <class name="image-button"/>
<class name="circular"/> <class name="circular"/>
<class name="ttl-avatar-button"/> <class name="ttl-flat-button"/>
</style> </style>
</object> </object>
<packing> <packing>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.36.0 --> <!-- Generated with glade 3.22.2 -->
<interface> <interface>
<requires lib="gtk+" version="3.22"/> <requires lib="gtk+" version="3.22"/>
<template class="TootleWidgetsAttachmentSlot" parent="GtkFlowBoxChild"> <template class="TootleWidgetsAttachmentSlot" parent="GtkFlowBoxChild">
@ -8,9 +8,11 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<child> <child>
<object class="GtkEventBox" id="event_box"> <object class="GtkButton" id="button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_clicked" swapped="no"/>
<child> <child>
<object class="GtkGrid" id="overlay"> <object class="GtkGrid" id="overlay">
<property name="visible">True</property> <property name="visible">True</property>
@ -22,6 +24,8 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">center</property> <property name="halign">center</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="margin_left">16</property>
<property name="margin_right">16</property>
<property name="margin_start">16</property> <property name="margin_start">16</property>
<property name="margin_end">16</property> <property name="margin_end">16</property>
<property name="margin_top">16</property> <property name="margin_top">16</property>
@ -46,6 +50,8 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
@ -74,7 +80,7 @@
<property name="height_request">32</property> <property name="height_request">32</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="opacity">0.5019607843137255</property> <property name="opacity">0.50196078431372548</property>
<property name="halign">center</property> <property name="halign">center</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
@ -91,11 +97,12 @@
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
</object> </object>
</child> </child>
<style>
<class name="flat"/>
<class name="ttl-flat-button"/>
</style>
</object> </object>
</child> </child>
<style> <style>

View File

@ -408,7 +408,7 @@
<class name="flat"/> <class name="flat"/>
<class name="image-button"/> <class name="image-button"/>
<class name="circular"/> <class name="circular"/>
<class name="ttl-avatar-button"/> <class name="ttl-flat-button"/>
</style> </style>
</object> </object>
<packing> <packing>

View File

@ -4,14 +4,10 @@ using Gdk;
[GtkTemplate (ui = "/com/github/bleakgrey/tootle/ui/widgets/attachment_slot.ui")] [GtkTemplate (ui = "/com/github/bleakgrey/tootle/ui/widgets/attachment_slot.ui")]
public class Tootle.Widgets.Attachment.Slot : FlowBoxChild { public class Tootle.Widgets.Attachment.Slot : FlowBoxChild {
[GtkChild] [GtkChild] Button button;
EventBox event_box; [GtkChild] Label chip;
[GtkChild] [GtkChild] Image play_icon;
Label chip; [GtkChild] Stack stack;
[GtkChild]
Image play_icon;
[GtkChild]
Stack stack;
public API.Attachment attachment { get; construct set; } public API.Attachment attachment { get; construct set; }
@ -42,8 +38,7 @@ public class Tootle.Widgets.Attachment.Slot : FlowBoxChild {
} }
construct { construct {
event_box.tooltip_text = attachment.description; button.tooltip_text = attachment.description;
event_box.button_release_event.connect (on_clicked);
} }
void download () { void download () {
@ -60,12 +55,9 @@ public class Tootle.Widgets.Attachment.Slot : FlowBoxChild {
() => {}); () => {});
} }
protected virtual bool on_clicked (EventButton ev) { [GtkCallback]
if (ev.button != 1) protected virtual void on_clicked () {
return false;
open (); open ();
return true;
} }
} }

View File

@ -23,7 +23,7 @@ public class Tootle.Widgets.Conversation : Widgets.Status {
if (conversation.accounts.last () != account) if (conversation.accounts.last () != account)
label += ", "; label += ", ";
} }
return @"$label"; return label;
} }
} }
@ -33,7 +33,7 @@ public class Tootle.Widgets.Conversation : Widgets.Status {
foreach (API.Account account in conversation.accounts) { foreach (API.Account account in conversation.accounts) {
label += account.handle + " "; label += account.handle + " ";
} }
return @"<small>$label</small>"; return label;
} }
} }