Fix header bar button spacing

This commit is contained in:
Bleak Grey 2020-11-12 13:57:35 +03:00
parent 7564a16a0b
commit 577f0c1b68
4 changed files with 11 additions and 24 deletions

View File

@ -18,12 +18,16 @@
border-radius:6px;
}
.header-title-button {
.ttl-header-button {
margin: 0px;
border-radius: 0px;
border-top: none;
border-bottom: none;
}
.ttl-header-button .title, .ttl-header-button .subtitle {
padding-left: 0px;
padding-right: 0px;
}
.padded.ttl-view {
margin: 32px 0 32px 0;

View File

@ -76,7 +76,7 @@
</child>
<style>
<class name="flat"/>
<class name="header-title-button"/>
<class name="ttl-header-button"/>
</style>
</template>
</interface>

View File

@ -93,18 +93,10 @@ public class Tootle.Entity : GLib.Object, Widgetizable, Json.Serializable {
}
return des_list (out val, node, contains);
}
else if (type.is_a (typeof (API.NotificationType)))
return des_notification_type (out val, node);
return success;
}
static bool des_notification_type (out Value val, Json.Node node) {
var str = node.get_string ();
val = API.NotificationType.from_string (str);
return true;
}
static bool des_list (out Value val, Json.Node node, Type type) {
if (!node.is_null ()) {
var arr = new Gee.ArrayList<Entity> ();
@ -123,19 +115,10 @@ public class Tootle.Entity : GLib.Object, Widgetizable, Json.Serializable {
if (type.is_a (typeof (Gee.ArrayList)))
return ser_list (prop, val, spec);
if (type.is_a (typeof (API.NotificationType)))
return ser_notification_type (prop, val, spec);
return default_serialize_property (prop, val, spec);
}
static Json.Node ser_notification_type (string prop, Value val, ParamSpec spec) {
var enum_val = (API.NotificationType) val;
var node = new Json.Node (NodeType.VALUE);
node.set_string (enum_val.to_string ());
return node;
}
static Json.Node ser_list (string prop, Value val, ParamSpec spec) {
var list = (Gee.ArrayList<Entity>) val;
if (list == null)

View File

@ -2,7 +2,7 @@ public enum Tootle.API.NotificationType {
MENTION,
REBLOG,
REBLOG_REMOTE_USER, // Internal
FAVORITE,
FAVOURITE,
FOLLOW,
FOLLOW_REQUEST, // Internal
WATCHLIST; // Internal
@ -15,7 +15,7 @@ public enum Tootle.API.NotificationType {
return "reblog";
case REBLOG_REMOTE_USER:
return "reblog_remote";
case FAVORITE:
case FAVOURITE:
return "favourite";
case FOLLOW:
return "follow";
@ -38,7 +38,7 @@ public enum Tootle.API.NotificationType {
case "reblog_remote":
return REBLOG_REMOTE_USER;
case "favourite":
return FAVORITE;
return FAVOURITE;
case "follow":
return FOLLOW;
case "follow_request":
@ -58,7 +58,7 @@ public enum Tootle.API.NotificationType {
return _("<span underline=\"none\"><a href=\"%s\">%s</a> boosted your status</span>").printf (account.url, account.display_name);
case REBLOG_REMOTE_USER:
return _("<span underline=\"none\"><a href=\"%s\">%s</a> boosted</span>").printf (account.url, account.display_name);
case FAVORITE:
case FAVOURITE:
return _("<span underline=\"none\"><a href=\"%s\">%s</a> favorited your status</span>").printf (account.url, account.display_name);
case FOLLOW:
return _("<span underline=\"none\"><a href=\"%s\">%s</a> now follows you</span>").printf (account.url, account.display_name);
@ -80,7 +80,7 @@ public enum Tootle.API.NotificationType {
case REBLOG:
case REBLOG_REMOTE_USER:
return "media-playlist-repeat-symbolic";
case FAVORITE:
case FAVOURITE:
return "starred-symbolic";
case FOLLOW:
case FOLLOW_REQUEST: