Clone in a terminal:
Commit 99c495a
Johan Mattsson - 2020-07-25T22:38:34+00:00
99c495afc8197ecff3567505c32b8ee607f0e8b3johan.mattsson.m@gmail.com

Fix selection in overview

Changed files (3)

Diff

diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex 66f0c7b..3a2100b 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -1361,6 +1361,22 @@ public class OverView : FontDisplay { 		 		for (int j = 0; j < visible_items.size; j++) { 			i = visible_items.get (j);+			if (i.click_menu (button, x, y)) {+				GlyphCanvas.redraw ();+				return;+			}+		}++		for (int j = 0; j < visible_items.size; j++) {+			i = visible_items.get (j);+			if (i.click_info (button, x, y)) {+				GlyphCanvas.redraw ();+				return;+			}+		}+				+		for (int j = 0; j < visible_items.size; j++) {+			i = visible_items.get (j); 			 			if (i.click (button, x, y)) { 				selected = index;diff --git a/libbirdfont/OverViewItem.vala b/libbirdfont/OverViewItem.valaindex b8fbfa0..1491518 100644--- a/libbirdfont/OverViewItem.vala+++ b/libbirdfont/OverViewItem.vala@@ -235,10 +235,9 @@ public class OverViewItem : GLib.Object { 		return height + margin; 	} 	-	public bool click (uint button, double px, double py) {+	public bool click_menu (uint button, double px, double py) { 		bool a; 		GlyphCollection g;-		bool s = (x <= px <= x + width) && (y <= py <= y + height);  		if (has_icons () && glyphs != null) { 			g = (!) glyphs;@@ -246,17 +245,32 @@ public class OverViewItem : GLib.Object { 			a = version_menu.menu_item_action (px, py); // select one item on the menu 			 			if (a) {-				return s;+				MainWindow.get_overview ().reset_cache ();+				MainWindow.get_overview ().update_item_list ();++				GlyphCanvas.redraw ();+				return true; 			} 			 			version_menu.menu_icon_action (px, py); // click in the open menu 		} 		+		return false;+	}+	+	public bool click_info (uint button, double px, double py) { 		info.set_position (x + width - 17, y + height - 22.5);+		 		if (has_icons () && info.is_over_icon (px, py)) { 			MainWindow.get_overview ().set_character_info (info);+			return true; 		}-				+		+		return false;+	}+	+	public bool click (uint button, double px, double py) {+		bool s = (x <= px <= x + width) && (y <= py <= y + height);		 		return s; 	} diff --git a/libbirdfont/VersionList.vala b/libbirdfont/VersionList.valaindex d40195e..43a7037 100644--- a/libbirdfont/VersionList.vala+++ b/libbirdfont/VersionList.vala@@ -387,6 +387,7 @@ public class VersionList : GLib.Object { 							ma = actions.get (index + 1); 							index++; 						}+ 					} 					return false; 				} else {

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112