1
0
mirror of https://gitlab.gnome.org/World/tootle synced 2025-02-16 19:40:41 +01:00

Use CSS typography classes, simplify label formatting code

This commit is contained in:
Bleak Grey 2020-10-24 06:23:23 +03:00
parent 5c0d98af9f
commit b7153be9cb
14 changed files with 426 additions and 252 deletions

View File

@ -2,24 +2,24 @@
<gresources>
<gresource prefix="/com/github/bleakgrey/tootle/">
<file alias="app.css">app.css</file>
<file preprocess="xml-stripblanks">ui/views/new_account.ui</file>
<file preprocess="xml-stripblanks">ui/views/base.ui</file>
<file preprocess="xml-stripblanks">ui/views/profile_header.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/status.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/accounts_button.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/accounts_button_item.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/profile_field_row.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/timeline_menu.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/list_item.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/list_editor_item.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/attachment_slot.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/compose_attachment.ui</file>
<file preprocess="xml-stripblanks">ui/widgets/adaptive_button.ui</file>
<file preprocess="xml-stripblanks">ui/dialogs/new_account.ui</file>
<file preprocess="xml-stripblanks">ui/dialogs/compose.ui</file>
<file preprocess="xml-stripblanks">ui/dialogs/main.ui</file>
<file preprocess="xml-stripblanks">ui/dialogs/preferences.ui</file>
<file preprocess="xml-stripblanks">ui/dialogs/list_editor.ui</file>
<file preprocess="xml-stripblanks">ui/menus.ui</file>
<file>ui/views/new_account.ui</file>
<file>ui/views/base.ui</file>
<file>ui/views/profile_header.ui</file>
<file>ui/widgets/status.ui</file>
<file>ui/widgets/accounts_button.ui</file>
<file>ui/widgets/accounts_button_item.ui</file>
<file>ui/widgets/profile_field_row.ui</file>
<file>ui/widgets/timeline_menu.ui</file>
<file>ui/widgets/list_item.ui</file>
<file>ui/widgets/list_editor_item.ui</file>
<file>ui/widgets/attachment_slot.ui</file>
<file>ui/widgets/compose_attachment.ui</file>
<file>ui/widgets/adaptive_button.ui</file>
<file>ui/dialogs/new_account.ui</file>
<file>ui/dialogs/compose.ui</file>
<file>ui/dialogs/main.ui</file>
<file>ui/dialogs/preferences.ui</file>
<file>ui/dialogs/list_editor.ui</file>
<file>ui/menus.ui</file>
</gresource>
</gresources>

View File

@ -127,10 +127,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">What is your instance?</property>
<attributes>
<attribute name="weight" value="ultrabold"/>
<attribute name="scale" value="1.7"/>
</attributes>
<style>
<class name="title-1"/>
</style>
</object>
<packing>
<property name="expand">False</property>
@ -240,11 +239,10 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Enter Authorization Code</property>
<attributes>
<attribute name="weight" value="ultrabold"/>
<attribute name="scale" value="1.7"/>
</attributes>
<property name="label" translatable="yes">Enter authorization code</property>
<style>
<class name="title-1"/>
</style>
</object>
<packing>
<property name="expand">False</property>
@ -329,10 +327,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">Hello, @user@instance.com!</property>
<attributes>
<attribute name="weight" value="ultrabold"/>
<attribute name="scale" value="1.7"/>
</attributes>
<style>
<class name="title-1"/>
</style>
</object>
<packing>
<property name="expand">False</property>

View File

@ -1,183 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Not generated with glade 3.36.0 and I hate it -->
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
<template class="TootleDialogsPreferences" parent="HdyPreferencesWindow">
<property name="default_height">400</property>
<property name="default_width">500</property>
<property name="width_request">300</property>
<property name="search_enabled">false</property>
<!--Application-->
<child>
<object class="HdyPreferencesPage">
<property name="icon_name">applications-system-symbolic</property>
<property name="title" translatable="yes">General</property>
<property name="visible">True</property>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Appearance</property>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="activatable_widget">dark_theme</property>
<property name="title" translatable="yes">Dark theme</property>
<child>
<object class="GtkSwitch" id="dark_theme">
<property name="visible">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Behavior</property>
<child>
<object class="HdyActionRow">
<property name="visible">False</property>
<property name="activatable_widget">autostart</property>
<property name="title" translatable="yes">Autostart</property>
<property name="subtitle" translatable="yes">Start minimized at boot</property>
<child>
<object class="GtkSwitch" id="autostart">
<property name="visible">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="visible">False</property>
<property name="activatable_widget">work_in_background</property>
<property name="title" translatable="yes">Background work</property>
<property name="subtitle" translatable="yes">Receive notifications even when the app window is closed</property>
<child>
<object class="GtkSwitch" id="work_in_background">
<property name="visible">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyComboRow" id="default_post_visibility">
<property name="visible">True</property>
<property name="title" translatable="yes">Default post visibility</property>
</object>
</child>
</object>
</child>
</object>
</child>
<!--Timelines-->
<child>
<object class="HdyPreferencesPage">
<property name="icon_name">view-list-symbolic</property>
<property name="title" translatable="yes">Timelines</property>
<property name="visible">True</property>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Appearance</property>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="activatable_widget">timeline_page_size</property>
<property name="title" translatable="yes">Posts per page</property>
<child>
<object class="GtkSpinButton" id="timeline_page_size">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="digits">0</property>
<property name="adjustment">page_adjustment</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="activatable_widget">post_text_size</property>
<property name="title" translatable="yes">Post text size (%)</property>
<child>
<object class="GtkSpinButton" id="post_text_size">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="digits">0</property>
<property name="adjustment">font_adjustment</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="title" translatable="yes">Behavior</property>
<child>
<object class="HdyActionRow" id="live_updates_row">
<property name="visible">True</property>
<property name="activatable_widget">live_updates</property>
<property name="title" translatable="yes">Stream timelines</property>
<property name="subtitle" translatable="yes">Add and remove posts in real-time</property>
<child>
<object class="GtkSwitch" id="live_updates">
<property name="visible">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="activatable_widget">public_live_updates</property>
<property name="sensitive" bind-source="live_updates" bind-property="state" bind-flags="sync-create"></property>
<property name="title" translatable="yes">Stream public timelines</property>
<property name="subtitle" translatable="yes">Warning: This will use more resources on crowded instances</property>
<child>
<object class="GtkSwitch" id="public_live_updates">
<property name="visible">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkAdjustment" id="page_adjustment">
<property name="lower">10</property>
<property name="upper">50</property>
<property name="page-increment">1</property>
<property name="step-increment">1</property>
</object>
<object class="GtkAdjustment" id="font_adjustment">
<property name="lower">100</property>
<property name="upper">500</property>
<property name="page-increment">10</property>
<property name="step-increment">10</property>
</object>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
<object class="GtkAdjustment" id="font_adjustment">
<property name="lower">100</property>
<property name="upper">500</property>
<property name="step_increment">5</property>
<property name="page_increment">5</property>
</object>
<object class="GtkAdjustment" id="page_adjustment">
<property name="lower">10</property>
<property name="upper">50</property>
<property name="step_increment">1</property>
<property name="page_increment">1</property>
</object>
<template class="TootleDialogsPreferences" parent="HdyPreferencesWindow">
<property name="width_request">300</property>
<property name="can_focus">False</property>
<property name="default_width">500</property>
<property name="default_height">600</property>
<property name="search_enabled">False</property>
<child>
<object class="HdyPreferencesPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">applications-system-symbolic</property>
<property name="title" translatable="yes">General</property>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Appearance</property>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Dark theme</property>
<property name="activatable_widget">dark_theme</property>
<child>
<object class="GtkSwitch" id="dark_theme">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="title" translatable="yes">Text scale (%)</property>
<property name="activatable_widget">post_text_size</property>
<child>
<object class="GtkSpinButton" id="post_text_size">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="text" translatable="yes">100</property>
<property name="progress_pulse_step">0.050000000000000003</property>
<property name="adjustment">font_adjustment</property>
<property name="value">100</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Behavior</property>
<child>
<object class="HdyActionRow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Autostart</property>
<property name="activatable_widget">autostart</property>
<property name="subtitle" translatable="yes">Start minimized at boot</property>
<child>
<object class="GtkSwitch" id="autostart">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Background work</property>
<property name="activatable_widget">work_in_background</property>
<property name="subtitle" translatable="yes">Receive notifications even when the app is closed</property>
<child>
<object class="GtkSwitch" id="work_in_background">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyComboRow" id="default_post_visibility">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Default post visibility</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyPreferencesGroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Timelines</property>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="title" translatable="yes">Posts per page</property>
<property name="activatable_widget">timeline_page_size</property>
<child>
<object class="GtkSpinButton" id="timeline_page_size">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="text" translatable="yes">10</property>
<property name="adjustment">page_adjustment</property>
<property name="value">10</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="can_focus">True</property>
<property name="title" translatable="yes">Infinite scrolling</property>
<property name="activatable_widget">infinite_scrolling</property>
<property name="subtitle" translatable="yes">Warning: This will increase memory usage</property>
<child>
<object class="GtkSwitch" id="infinite_scrolling">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow" id="live_updates_row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="title" translatable="yes">Stream timelines</property>
<property name="activatable_widget">live_updates</property>
<property name="subtitle" translatable="yes">Receive new posts and notifications in real-time</property>
<child>
<object class="GtkSwitch" id="live_updates">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="visible">True</property>
<property name="sensitive" bind-source="live_updates" bind-property="state" bind-flags="sync-create">False</property>
<property name="can_focus">True</property>
<property name="title" translatable="yes">Stream public timelines</property>
<property name="activatable_widget">public_live_updates</property>
<property name="subtitle" translatable="yes">Warning: This will increase memory usage</property>
<child>
<object class="GtkSwitch" id="public_live_updates">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@ -54,8 +54,8 @@
<object class="HdyClamp" id="clamp">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="maximum_size">650</property>
<property name="tightening_threshold">650</property>
<property name="maximum_size">700</property>
<property name="tightening_threshold">700</property>
<child>
<object class="GtkBox" id="column_view">
<property name="visible">True</property>

View File

@ -61,6 +61,9 @@
<object class="TootleWidgetsRichLabel" id="handle">
<property name="visible">True</property>
<property name="selectable">True</property>
<style>
<class name="title-1"/>
</style>
</object>
<packing>
<property name="expand">False</property>

View File

@ -35,6 +35,9 @@
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkFlowBox" id="actions">
<property name="visible">True</property>
@ -173,7 +176,152 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFlowBox">
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<property name="column_spacing">6</property>
<property name="min_children_per_line">3</property>
<property name="max_children_per_line">3</property>
<property name="selection_mode">none</property>
<property name="activate_on_single_click">False</property>
<child>
<object class="GtkFlowBoxChild">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">POSTS</property>
<style>
<class name="caption"/>
</style>
</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="label" translatable="yes">1K</property>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFlowBoxChild">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">FOLLOWING</property>
<style>
<class name="caption"/>
</style>
</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="label" translatable="yes">64</property>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFlowBoxChild">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">FOLLOWERS</property>
<style>
<class name="caption"/>
</style>
</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="label" translatable="yes">24</property>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
@ -185,7 +333,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">4</property>
</packing>
</child>
<child>
@ -198,7 +346,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">5</property>
</packing>
</child>
<child>
@ -211,7 +359,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">6</property>
</packing>
</child>
<child>
@ -225,7 +373,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
<property name="position">7</property>
</packing>
</child>
</object>

View File

@ -89,9 +89,9 @@
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
@ -104,10 +104,13 @@
<property name="can_focus">False</property>
<property name="opacity">0.5</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Handle</property>
<property name="label" translatable="no">Handle</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<property name="xalign">0</property>
<style>
<class name="body"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>

View File

@ -28,9 +28,9 @@
<property name="yalign">0</property>
<property name="max-width-chars">1</property>
<property name="justify">right</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>

View File

@ -57,6 +57,9 @@
<property name="xalign">0</property>
<property name="margin-bottom">8</property>
<property name="track_visited_links">false</property>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
@ -74,9 +77,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Name</property>
<property name="label" translatable="no">Name</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<style>
<class name="title-4"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
@ -92,6 +98,9 @@
<property name="opacity">0.5</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<style>
<class name="body"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
@ -139,6 +148,9 @@
<property name="can_focus">False</property>
<property name="label" translatable="no">Yesterday</property>
<property name="opacity">0.5</property>
<style>
<class name="body"/>
</style>
</object>
<packing>
<property name="expand">False</property>

View File

@ -53,19 +53,19 @@ public enum Tootle.API.NotificationType {
public string get_desc (Account? account) {
switch (this) {
case MENTION:
return _("<span underline=\"none\"><a href=\"%s\"><b>%s</b></a> mentioned you</span>").printf (account.url, account.display_name);
return _("<span underline=\"none\"><a href=\"%s\">%s</a> mentioned you</span>").printf (account.url, account.display_name);
case REBLOG:
return _("<span underline=\"none\"><a href=\"%s\"><b>%s</b></a> boosted your status</span>").printf (account.url, account.display_name);
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\"><b>%s</b></a> boosted</span>").printf (account.url, account.display_name);
return _("<span underline=\"none\"><a href=\"%s\">%s</a> boosted</span>").printf (account.url, account.display_name);
case FAVORITE:
return _("<span underline=\"none\"><a href=\"%s\"><b>%s</b></a> favorited your status</span>").printf (account.url, account.display_name);
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\"><b>%s</b></a> now follows you</span>").printf (account.url, account.display_name);
return _("<span underline=\"none\"><a href=\"%s\">%s</a> now follows you</span>").printf (account.url, account.display_name);
case FOLLOW_REQUEST:
return _("<span underline=\"none\"><a href=\"%s\"><b>%s</b></a> wants to follow you</span>").printf (account.url, account.display_name);
return _("<span underline=\"none\"><a href=\"%s\">%s</a> wants to follow you</span>").printf (account.url, account.display_name);
case WATCHLIST:
return _("<span underline=\"none\"><a href=\"%s\"><b>%s</b></a> posted a status</span>").printf (account.url, account.display_name);
return _("<span underline=\"none\"><a href=\"%s\">%s</a> posted a status</span>").printf (account.url, account.display_name);
default:
warning (@"Unknown notification type: $this");
return "";

View File

@ -12,7 +12,8 @@ public class Tootle.Dialogs.MainWindow: Hdy.Window, ISavedWindow {
Views.Base? last_view = null;
construct {
settings.bind_property ("dark-theme", Gtk.Settings.get_default (), "gtk-application-prefer-dark-theme", BindingFlags.SYNC_CREATE);
var gtk_settings = Gtk.Settings.get_default ();
settings.bind_property ("dark-theme", gtk_settings, "gtk-application-prefer-dark-theme", BindingFlags.SYNC_CREATE);
settings.notify["post-text-size"].connect (() => on_zoom_level_changed ());
on_zoom_level_changed ();
@ -77,13 +78,18 @@ public class Tootle.Dialogs.MainWindow: Hdy.Window, ISavedWindow {
}
void on_zoom_level_changed () {
var css ="""
.%s label {
font-size: %i%;
}
""".printf (ZOOM_CLASS, settings.post_text_size);
try {
var scale = settings.post_text_size;
var css = "";
if (scale > 100) {
css ="""
.%s label {
font-size: %i%;
}
""".printf (ZOOM_CLASS, scale);
}
app.zoom_css_provider.load_from_data (css);
}
catch (Error e) {

View File

@ -3,7 +3,7 @@ public class Tootle.Views.Hashtag : Views.Timeline {
public Hashtag (string tag) {
Object (
url: @"/api/v1/timelines/tag/$tag",
label: tag
label: "#"+tag
);
}

View File

@ -44,11 +44,7 @@ public class Tootle.Views.Profile : Views.Timeline {
menu_button.subtitle.show ();
var handle = builder.get_object ("handle") as Widgets.RichLabel;
profile.bind_property ("display-name", handle, "text", BindingFlags.SYNC_CREATE, (b, src, ref target) => {
var text = (string) src;
target.set_string (@"<span size=\"x-large\" weight=\"bold\">$text</span>");
return true;
});
profile.bind_property ("display-name", handle, "text", BindingFlags.SYNC_CREATE);
note_row = builder.get_object ("note_row") as ListBoxRow;
var note = builder.get_object ("note") as Widgets.RichLabel;

View File

@ -73,21 +73,19 @@ public class Tootle.Widgets.Status : ListBoxRow {
protected string date {
owned get {
var date = status.formal.created_at;
return @"<small>$(DateTime.humanize (date))</small>";
return DateTime.humanize (status.formal.created_at);
}
}
public string title_text {
owned get {
var name = Html.simplify (status.formal.account.display_name);
return @"<b>$name</b>";
return Html.simplify (status.formal.account.display_name);
}
}
public string subtitle_text {
owned get {
return @"<small>$(status.formal.account.handle)</small>";
return status.formal.account.handle;
}
}