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>
<parameter key="TEXT" type="text" optional="false">
<help>A (missing) text value.</help>
</parameter>
<parameter key="TEXT" label="" type="text" optional="false" default="def">
<help>How it looks for explicitly empty labels</help>
</parameter>
<parameter key="TEXT" type="text" optional="false" default="${env:USeR}">
<help>Styling of invalid expression</help>
</parameter>
<parameter key="CHECK" type="checkbox" caption="check me" optional="false" default="true">
<help>Old styling for special cases without label</help>
</parameter>
<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>
<parameter key="CHECKLIST" type="checklist" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
</parameter>
<parameter key="CHOICE" type="choice" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
</parameter>
<parameter key="DATE" type="datetime" optional="false"/>
<parameter key="COMBO" type="alternative" optional="false" default="OP1">
<option value="OP1"/>
<option value="OP2"/>
</parameter>
<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>
<parameter key="FILE" type="file" optional="false" default="file.pro"/>
<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>
<parameter key="SELECT" type="selector" optional="false">
<option value="SEL1"/>
<option value="SEL2"/>
<parameter key="SEL_NUM::%" type="number" template="true" optional="false"/>
</parameter>
<parameter key="STATION#" type="text" optional="false" replicate="true">
<help>Non-optional replicator</help>
</parameter>
<parameter key="REPLICATE#" type="number" optional="false" replicate="true" default="777">
<help>... with a default value</help>
</parameter>
<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>
</parameter>
</section>
</inishell_config>
<inishell_config application="SECTION_TEST">
<section name="General">
<parameter key="GEN_TEXT" type="text"/>
</section>
<section name="Input" replicate="true">
<parameter key="INUM" type="number"/>
</section>
<section name="OUTPUT" replicate="true">
<parameter key="ONUM" type="number" format="integer+"/>
</section>
<section name="Meteo">
<parameter key="TXT" type="text"/>
</section>
</inishell_config>
......@@ -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)
continue;
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_; }
protected:
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