Skip to content

Commit

Permalink
fix#80
Browse files Browse the repository at this point in the history
  • Loading branch information
artemanufrij committed Oct 30, 2018
1 parent 5fbf355 commit 5a74722
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions data/com.github.artemanufrij.webpin.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
</screenshot>
</screenshots>
<releases>
<release version="1.0.2" date="2018-11-02">
<description>
<p>New:</p>
<ul>
<li>Sort items inside app overview</li>
</ul>
<p>Fixed:</p>
<ul>
<li>Custom icon was replaced by default one</li>
</ul>
</description>
</release>
<release version="1.0.1" date="2018-10-30">
<description>
<p>New:</p>
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Views/Editor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ namespace Webpin.Widgets.Views {

private void on_accept () {
string icon = icon_name_entry.get_text ();
if (tmp_icon_file != "") {
if (tmp_icon_file != "" && tmp_icon_file == icon) {
var new_icon = GLib.Path.build_filename (WebpinApp.instance.CACHE_FOLDER, app_name_entry.get_text () + tmp_icon_ext);
uint8[] content;
try {
Expand Down
8 changes: 8 additions & 0 deletions src/Widgets/Views/WebItemsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ namespace Webpin.Widgets.Views {
scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER;

web_items = new Gtk.FlowBox();
web_items.set_sort_func (sort_func);
web_items.valign = Gtk.Align.START;
web_items.vexpand = false;
web_items.homogeneous = true;
Expand Down Expand Up @@ -108,5 +109,12 @@ namespace Webpin.Widgets.Views {
}
}
}

public int sort_func (Gtk.FlowBoxChild child1, Gtk.FlowBoxChild child2) {
var item1 = (WebItem)child1;
var item2 = (WebItem)child2;

return item1.title.collate (item2.title);
}
}
}
6 changes: 6 additions & 0 deletions src/Widgets/WebItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
namespace Webpin.Widgets {
public class WebItem : Gtk.FlowBoxChild {

public string title {
get {
return desktop_file.name;
}
}

Gtk.Image image;
Gtk.Label label;

Expand Down

0 comments on commit 5a74722

Please sign in to comment.