WSL/SLF GitLab Repository

Commit 3f3478c1 authored by Michael Reisecker's avatar Michael Reisecker
Browse files

Minor improvement to linking to panels

Now we focus on the styling widget (usually the label), to scroll to the
beginning of the content.
(Otherwise the horizontal scroll bar would center)
Also: use the same color for frame and panel highlighting.
parent c6dd4ec0
......@@ -19,7 +19,7 @@ Releases of the INIshell project will be documented in this file.
- Help is now displayed in a separate browser
(handling all help topics)
- Settings are now a separate window:
No more "click to save", "clear" button (in addition to cmd line)
Standard "reset", "save" and "clear" buttons (in addition to cmd line)
- Display sections for missing INI keys
- Jump to 1st missing input value if saving is cancelled
......@@ -37,6 +37,7 @@ Releases of the INIshell project will be documented in this file.
- Tests
- Transportation of unknown keys to preview and output
- Example simulation paths with new working directory field
- Several minor bugs
### Framework
......@@ -44,6 +45,7 @@ Releases of the INIshell project will be documented in this file.
(therefore XMLs can now transparently loaded into any area we'd like)
- Easy usage of "do not show again" dialogs now possible
- Major refactoring and logic improvements in MainWindow and MainPanel
- "Highlight" functionality for all input panels
## [2.0.5] - 2020-12-16
<inishell_config application="STYLE_TEST">
<section name="General">
<parameter type="label" label="&lt;h3&gt;Default and non-optional styling&lt;/h3&gt;"/>
<parameter type="helptext" wrap="true">
<help>New styling applies to the label instead of the entry widget.</help>
<parameter key="TEXT" type="text" optional="false">
<help>A (missing) text value.</help>
<parameter key="TEXT" label="" type="text" optional="false" default="def">
<help>How it looks for explicitly empty labels</help>
<parameter key="TEXT" type="text" optional="false" default="${env:USeR}">
<help>Styling of invalid expression</help>
<parameter key="CHECK" type="checkbox" caption="check me" optional="false" default="true">
<help>Old styling for special cases without label</help>
<parameter key="CHK2" type="checkbox" label="CHK2" caption="check me too" optional="false" default="true">
<help>... but not if the box does have a label</help>
<parameter key="CHECKLIST" type="checklist" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
<parameter key="CHOICE" type="choice" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
<parameter key="DATE" type="datetime" optional="false"/>
<parameter key="COMBO" type="alternative" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
<parameter key="" type="alternative" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
<help>Combobox that is only a container (without a key)</help>
<parameter key="FILE" type="file" optional="false" default=""/>
<parameter key="NUM" type="number" format="integer" optional="false"/>
<parameter key="NUM" type="number" format="integer" optional="false" default="${{sin(3)}}">
<help>Styling of a valid formula - change to see invalid one</help>
<parameter key="SELECT" type="selector" optional="false">
<option value="SEL1"/>
<option value="SEL2"/>
<parameter key="SEL_NUM::%" type="number" template="true" optional="false"/>
<parameter key="STATION#" type="text" optional="false" replicate="true">
<help>Non-optional replicator</help>
<parameter key="REPLICATE#" type="number" optional="false" replicate="true" default="777">
<help>... with a default value</help>
<parameter type="helptext" wrap="true">
<help>&lt;br&gt;Click link to &lt;a href=&quot;app://general::TEXT&quot;&gt;find the TEXT panel&lt;/a&gt;.</help>
<inishell_config application="SECTION_TEST">
<section name="General">
<parameter key="GEN_TEXT" type="text"/>
<section name="Input" replicate="true">
<parameter key="INUM" type="number"/>
<section name="OUTPUT" replicate="true">
<parameter key="ONUM" type="number" format="integer+"/>
<section name="Meteo">
<parameter key="TXT" type="text"/>
......@@ -409,7 +409,7 @@ bool SectionTab::showPanel(const QString &section, const QString &element_key)
auto panel = getMainWindow()->getControlPanel()->getSectionTab()->findChild<Atomic *>(Atomic::getQtKey(id));
if (!panel)
parent->ensureWidgetVisible(panel); //scroll the ScrollBar until visible
parent->ensureWidgetVisible(panel->getEmphasisWidget()); //scroll the ScrollBar until visible
panel->setHighlightedStyle(); //TODO: make it work for Selectors (their keys can not match)
found = true; //at least one was highlighted
......@@ -128,8 +128,8 @@ void Atomic::setHighlightedStyle(const bool &on, const int &reset_interval)
if (me) {
QString stylesheet_copy( getEmphasisWidget()->styleSheet() );
getEmphasisWidget()->setStyleSheet(stylesheet_copy.replace( //flash frame border color
colors::getQColor(on? "frameborder" : "important").name(QColor::HexRgb).toLower(),
colors::getQColor(on? "important" : "frameborder").name()));
colors::getQColor(on? "frameborder" : "sl_yellow").name(QColor::HexRgb).toLower(),
colors::getQColor(on? "sl_yellow" : "frameborder").name()));
} else {
emphasis_widget_->setProperty("highlight", (on? "true" : "false"));
......@@ -55,10 +55,10 @@ class Atomic : public QWidget {
QString getIniValue(QString &section, QString &key) const noexcept;
virtual void clear(const bool &set_default = true);
void setHighlightedStyle(const bool &on = true, const int &reset_interval = 5000);
QWidget * getEmphasisWidget() { return emphasis_widget_; }
void setEmphasisWidget(QWidget *emphasis_widget, const bool &set_object_name = true);
QWidget * getEmphasisWidget() { return emphasis_widget_; }
QString getId() const noexcept { return section_ + Cst::sep + key_; }
void setPanelStyle(const PanelStyle &style, const bool &set = true, QWidget *widget = nullptr);
void setValidPanelStyle(const bool &on);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment