From 5b14e83ebf726c7d6be1d607c6c837c5417f89da Mon Sep 17 00:00:00 2001
From: Ichthyostega
Date: Sun, 23 Sep 2018 16:20:24 +0200
Subject: [PATCH] NotificationDisplay: investigate options to organise error
display markup
...just to decide not to follow-up too much on that topic right now.
As it turns out, GTK seems to be lacking in that respect. I have plotted
some ideas how we could work around that discrepancy in future...
And for this simple DemoGuiRoundtrip, we'll just use direct styling,
but we'll store a table of bookmarks for the error entries, allowing
us to add further features later on top
---
doc/technical/gui/guiTheme.txt | 2 +
src/gui/widget/error-log-display.hpp | 32 +++-
wiki/thinkPad.ichthyo.mm | 262 ++++++++++++++++++++++++++-
3 files changed, 281 insertions(+), 15 deletions(-)
diff --git a/doc/technical/gui/guiTheme.txt b/doc/technical/gui/guiTheme.txt
index 92fb9b3da..f28327e57 100644
--- a/doc/technical/gui/guiTheme.txt
+++ b/doc/technical/gui/guiTheme.txt
@@ -29,6 +29,8 @@ Recommended reading
and
https://developer.gnome.org/gtk3/3.4/GtkStyleContext.html#gtkstylecontext-classes[predefined style classes]
in the GTK-3 reference manual.
+ * there is an https://developer.gnome.org/gtk3/stable/chap-css-overview.html[overview page in the developer manual],
+ and a https://developer.gnome.org/gtk3/stable/chap-css-properties.html[reference of supported properties].
* to start, look at this http://thegnomejournal.wordpress.com/2011/03/15/styling-gtk-with-css/[introductory text],
or the more http://worldofgnome.org/making-gtk3-themes-part-1-basics/[hands-on series of articles from world of gnome]
* this http://forums.fedoraforum.org/showthread.php?t=281568[post from fedora forum] features a conciese description
diff --git a/src/gui/widget/error-log-display.hpp b/src/gui/widget/error-log-display.hpp
index 01ae3ad54..16db9d413 100644
--- a/src/gui/widget/error-log-display.hpp
+++ b/src/gui/widget/error-log-display.hpp
@@ -63,13 +63,15 @@
//#include "lib/util.hpp"
//#include
-//#include
+#include
namespace gui {
namespace widget {
+ using std::vector;
+
/**
* @todo WIP-WIP as of 9/2017
@@ -79,11 +81,18 @@ namespace widget {
class ErrorLogDisplay
: public Gtk::ScrolledWindow
{
+
+ using Mark = Glib::RefPtr;
+
+ vector errorMarks_;
+ Gtk::TextView textLog_;
+
public:
~ErrorLogDisplay() { };
ErrorLogDisplay()
: Gtk::ScrolledWindow()
+ , errorMarks_{}
, textLog_{}
{
set_size_request (200, 80); // must be > 50 for the scrollbar to work properly
@@ -115,10 +124,17 @@ namespace widget {
showMsg (NOTE_INFO, text);
}
+ /** present an error notification prominently.
+ * Adds the error text, formatted accordingly to stand out,
+ * but also stores a [Mark] to bookmark the presence of this
+ * error entry. And finally expand the display if collapsed.
+ *
+ * [Mark]: https://developer.gnome.org/gtkmm-tutorial/stable/sec-textview-buffer.html.en#textview-marks
+ */
void
addError (string text)
{
- UNIMPLEMENTED ("add error with special tag and bookmark");
+ showMsg (NOTE_ERROR, text);
}
void
@@ -161,13 +177,15 @@ namespace widget {
}
- Gtk::TextView textLog_;
-
/** add message entry to the (ever growing) text buffer.
- * @remark According to the Gtkmm tutorial, TextView::scroll_to(iter) is not reliable;
+ * @remark According to the [GTKmm tutorial], `TextView::scroll_to(iter)` is not reliable;
* rather we need to use a text mark and set that text mark to the insert position.
- * Actually, there is always one predefined text mark called "insert", which corresponds
- * to the text cursor. Thus it suffices to navigate to text end, insert and scroll into view.
+ * Actually, there is always one predefined text mark [called "insert"][insert-mark],
+ * which corresponds to the text cursor. Thus it suffices to navigate to text end,
+ * insert and scroll into view.
+ *
+ * [GTKmm tutorial]: https://developer.gnome.org/gtkmm-tutorial/stable/sec-textview-buffer.html.en#textview-marks
+ * [insert-mark]: https://developer.gnome.org/gtkmm/3.22/classGtk_1_1TextMark.html#details
*/
void
addEntry (string const& text)
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm
index e87c25dd7..0af493d80 100644
--- a/wiki/thinkPad.ichthyo.mm
+++ b/wiki/thinkPad.ichthyo.mm
@@ -1718,7 +1718,7 @@
-
+
@@ -1740,7 +1740,8 @@
-
+
+
@@ -1776,7 +1777,7 @@
-
+
@@ -1967,11 +1968,107 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ YAGNI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3921,7 +4018,75 @@
-
+
+
+
+
+
+
+
+
+ Definition: komplexe Widget-Strukturen,
+
+
+ welche nur einmal in dieser speziellen Konfiguration exisiteren,
+
+
+ und dabei eine zentrale Rolle im UI spielen.
+
+
+
+
+
+ Beispiel:
+
+
+ -
+ Timeline
+
+ -
+ Property-Grid
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Definition: speziell konfigurierte und verdrahtete Teil-Komponenten,
+
+
+ welche wiederholt an verschiedensten Stellen im UI eingesetzt werden,
+
+
+ und sich dort jeweils konsistent und uniform verhalten.
+
+
+ Beispiel:
+
+
+ -
+ Timecode-Widget
+
+ -
+ Placement-Widget
+
+
+
+
+
+
+
+
+
@@ -3993,6 +4158,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -36779,12 +36959,14 @@
+
+
-
+
@@ -36822,6 +37004,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37591,7 +37836,7 @@
-
+
@@ -37605,6 +37850,7 @@
+
@@ -37987,7 +38233,7 @@