Skip to content

Commit 5a74722

Browse files
committed
fix#80
1 parent 5fbf355 commit 5a74722

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

data/com.github.artemanufrij.webpin.appdata.xml

+12
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
</screenshot>
3434
</screenshots>
3535
<releases>
36+
<release version="1.0.2" date="2018-11-02">
37+
<description>
38+
<p>New:</p>
39+
<ul>
40+
<li>Sort items inside app overview</li>
41+
</ul>
42+
<p>Fixed:</p>
43+
<ul>
44+
<li>Custom icon was replaced by default one</li>
45+
</ul>
46+
</description>
47+
</release>
3648
<release version="1.0.1" date="2018-10-30">
3749
<description>
3850
<p>New:</p>

src/Widgets/Views/Editor.vala

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ namespace Webpin.Widgets.Views {
488488

489489
private void on_accept () {
490490
string icon = icon_name_entry.get_text ();
491-
if (tmp_icon_file != "") {
491+
if (tmp_icon_file != "" && tmp_icon_file == icon) {
492492
var new_icon = GLib.Path.build_filename (WebpinApp.instance.CACHE_FOLDER, app_name_entry.get_text () + tmp_icon_ext);
493493
uint8[] content;
494494
try {

src/Widgets/Views/WebItemsView.vala

+8
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace Webpin.Widgets.Views {
4444
scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER;
4545

4646
web_items = new Gtk.FlowBox();
47+
web_items.set_sort_func (sort_func);
4748
web_items.valign = Gtk.Align.START;
4849
web_items.vexpand = false;
4950
web_items.homogeneous = true;
@@ -108,5 +109,12 @@ namespace Webpin.Widgets.Views {
108109
}
109110
}
110111
}
112+
113+
public int sort_func (Gtk.FlowBoxChild child1, Gtk.FlowBoxChild child2) {
114+
var item1 = (WebItem)child1;
115+
var item2 = (WebItem)child2;
116+
117+
return item1.title.collate (item2.title);
118+
}
111119
}
112120
}

src/Widgets/WebItem.vala

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
namespace Webpin.Widgets {
3030
public class WebItem : Gtk.FlowBoxChild {
3131

32+
public string title {
33+
get {
34+
return desktop_file.name;
35+
}
36+
}
37+
3238
Gtk.Image image;
3339
Gtk.Label label;
3440

0 commit comments

Comments
 (0)