Skip to content

Commit

Permalink
minimode styling
Browse files Browse the repository at this point in the history
  • Loading branch information
donpdonp committed Jul 10, 2019
1 parent 8bf6280 commit 0c8f590
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 43 deletions.
113 changes: 71 additions & 42 deletions glade/toot.glade
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,43 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_author_name">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">author_name</property>
<style>
<class name="toot_author_name"/>
</style>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="toot_author_name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">author_name</property>
<style>
<class name="toot_author_name"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_author_url">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">author url</property>
<style>
<class name="toot_author_url"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
Expand All @@ -57,36 +87,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_date">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">date</property>
<style>
<class name="toot_date"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_author_url">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">url</property>
<style>
<class name="toot_author_url"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<style>
<class name="toot_header_box"/>
</style>
Expand All @@ -98,27 +98,56 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_text">
<property name="visible">True</property>
<object class="GtkLabel" id="toot_author_url_minimode">
<property name="can_focus">False</property>
<property name="label" translatable="yes">body text</property>
<property name="label" translatable="yes">author url mini</property>
<style>
<class name="toot_text"/>
<class name="toot_author_url_minimode"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_date">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">date</property>
<style>
<class name="toot_date"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="toot_text">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">toot text</property>
<style>
<class name="toot_text"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="image_box">
<property name="visible">True</property>
Expand All @@ -131,7 +160,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand All @@ -143,7 +172,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
Expand Down
4 changes: 4 additions & 0 deletions src/gui/gtk.zig
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ pub fn makeTootBox(toot: toot_lib.Toot(), colconfig: *config.ColumnConfig) [*c]c
labelBufPrint(name_label, "{}", author_name);
const url_label = builder_get_widget(builder, c"toot_author_url");
labelBufPrint(url_label, "{}", author_url);
const author_url_minimode_label = builder_get_widget(builder, c"toot_author_url_minimode");
labelBufPrint(author_url_minimode_label, "{}", author_url);
const date_label = builder_get_widget(builder, c"toot_date");
labelBufPrint(date_label, "{}", created_at);

Expand All @@ -370,10 +372,12 @@ pub fn makeTootBox(toot: toot_lib.Toot(), colconfig: *config.ColumnConfig) [*c]c
c.gtk_label_set_line_wrap(@ptrCast([*c]c.GtkLabel, toottext_label), 1);
c.gtk_label_set_text(@ptrCast([*c]c.GtkLabel, toottext_label), cText);


if(colconfig.img_only) {
c.gtk_widget_hide(toottext_label);
const id_row = builder_get_widget(builder, c"toot_id_row");
c.gtk_widget_hide(id_row);
c.gtk_widget_show(author_url_minimode_label);
}
photo_refresh(author_acct, builder);

Expand Down
7 changes: 6 additions & 1 deletion theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
}

.toot_author_url {
color:white;
color: white;
background-color: #111;
}

.toot_author_url_minimode {
color: white;
background-color: #111;
}

Expand Down

0 comments on commit 0c8f590

Please sign in to comment.