NotificationDisplay: experiment to build a collapsed display
basically Gtk::Expander will do the trick. However, resizing of the enclosing panel is not handled properly, the log does not expand to take up the available space, as it did automaticall when just added directly into the frame
This commit is contained in:
parent
a0b80d8a46
commit
bc3eb7f8da
4 changed files with 52 additions and 8 deletions
|
|
@ -44,6 +44,7 @@ namespace panel{
|
|||
, twoParts_{Gtk::ORIENTATION_VERTICAL}
|
||||
, buttons_{}
|
||||
, frame_{"UI Integration Experiments"}
|
||||
, logExpander_{"Error Log"}
|
||||
, theLog_{}
|
||||
{
|
||||
twoParts_.pack_start(frame_);
|
||||
|
|
@ -88,9 +89,13 @@ namespace panel{
|
|||
if (not theLog_)
|
||||
{
|
||||
theLog_.reset (new ErrorLogDisplay{});
|
||||
logExpander_.set_expanded (true);
|
||||
logExpander_.add (*theLog_);
|
||||
frame_.set_border_width (5);
|
||||
frame_.add (*theLog_);
|
||||
frame_.show_all(); ///////////////TODO necessary?
|
||||
frame_.add (logExpander_);
|
||||
// frame_.add (*theLog_);
|
||||
// frame_.check_resize();
|
||||
frame_.show_all();
|
||||
}
|
||||
return *theLog_;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ namespace panel{
|
|||
Gtk::ButtonBox buttons_;
|
||||
Gtk::Button button_1_;
|
||||
Gtk::Frame frame_;
|
||||
Gtk::Expander logExpander_;
|
||||
|
||||
std::unique_ptr<widget::ErrorLogDisplay> theLog_;
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace widget {
|
|||
: Gtk::ScrolledWindow()
|
||||
, textLog_{}
|
||||
{
|
||||
set_size_request (200, 50);
|
||||
set_size_request (200, 80); // must be > 50 for the scrollbar to work properly
|
||||
set_border_width (10);
|
||||
set_shadow_type (Gtk::SHADOW_NONE);
|
||||
|
||||
|
|
@ -93,7 +93,6 @@ namespace widget {
|
|||
set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
|
||||
this->add (textLog_);
|
||||
textLog_.set_editable (false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1744,8 +1744,46 @@
|
|||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534725109137" ID="ID_694776463" MODIFIED="1534725415160" TEXT="expand">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534725397553" ID="ID_1072347956" MODIFIED="1534725407905" TEXT="collapsed-Repräsentation schaffen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534725397553" ID="ID_1072347956" MODIFIED="1535563380736" TEXT="collapsed-Repräsentation schaffen">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1535554610295" ID="ID_1050608842" MODIFIED="1535554619117" TEXT="nur vorläufige Lösung">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node CREATED="1535554620165" ID="ID_1243930693" MODIFIED="1535554624774" TEXT="Gtk::Expander">
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1535557111546" ID="ID_649935976" MODIFIED="1535557120786" TEXT="Label-Text als ctor param"/>
|
||||
<node CREATED="1535557122205" ID="ID_1034248466" MODIFIED="1535557176171" TEXT="resize_toplevel (=true by default)">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
...ob beim Expand/Collapse das umschließende Widget resized werden soll
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1535563193014" ID="ID_1551506828" MODIFIED="1535563373775" TEXT="Problem: dehnt sich nicht aus">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1535563256725" ID="ID_327777357" MODIFIED="1535563288805" TEXT="scrolled pane belegt nur minimal notwendigen Platz"/>
|
||||
<node CREATED="1535563300695" ID="ID_862867674" MODIFIED="1535563311905" TEXT="egal ob initial zugeklappt (=default) oder aufgeklappt"/>
|
||||
<node CREATED="1535563317214" ID="ID_201611533" MODIFIED="1535563330839" TEXT="egal in welcher Reihenfolge man es hinzufügt"/>
|
||||
<node CREATED="1535563334050" ID="ID_718726647" MODIFIED="1535563366331" TEXT="dagegen direkt im Frame dehnt sie sich aus"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1535554640586" ID="ID_1376241476" MODIFIED="1535554936517" TEXT="essentiell: passiert im Parent-Widget">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>...wesentliches Struktur-Element:</p>
|
||||
<p>der Parent-Container ist für das expand/collapse zuständig</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534725101578" ID="ID_974315967" MODIFIED="1534725412673" TEXT="clearAll">
|
||||
|
|
@ -2106,7 +2144,7 @@
|
|||
<node CREATED="1534721417590" ID="ID_1471234946" MODIFIED="1534721567118" STYLE="fork" TEXT="das erübrigt Verwalten eines eigenen Signales">
|
||||
<linktarget COLOR="#69b2a9" DESTINATION="ID_1471234946" ENDARROW="Default" ENDINCLINATION="37;-44;" ID="Arrow_ID_1612034198" SOURCE="ID_997317939" STARTARROW="None" STARTINCLINATION="-209;0;"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1534729080597" ID="ID_1547931497" MODIFIED="1534729118672" TEXT="Code durchgesehen: alle Zugriffe sauber">
|
||||
<node COLOR="#338800" CREATED="1534729080597" ID="ID_1547931497" MODIFIED="1535556768694" TEXT="Code durchgesehen: alle Zugriffe sauber">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
|
|
@ -2119,7 +2157,8 @@
|
|||
oder sie prüfen den Zustand und machen nichts, wenn das Widget nicht da ist
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1534721435740" ID="ID_1066281960" MODIFIED="1534721509684" TEXT="Konvention: Fehlerlog-Widget zerstören">
|
||||
|
|
|
|||
Loading…
Reference in a new issue