From a29bd0924da73593031216a4929a4b42954af814 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 22 Apr 2019 10:18:02 +0300 Subject: [PATCH] Cosmetic changes --- src/Config/Config_FeatureMessage.cpp | 13 ++++++++++++- src/Config/Config_FeatureMessage.h | 8 +++++--- src/Config/Config_FeatureReader.cpp | 7 +++++-- src/Config/Config_Keywords.h | 1 + src/ModuleBase/ModuleBase_Tools.cpp | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Config/Config_FeatureMessage.cpp b/src/Config/Config_FeatureMessage.cpp index c650cf482..fdc684cc3 100644 --- a/src/Config/Config_FeatureMessage.cpp +++ b/src/Config/Config_FeatureMessage.cpp @@ -38,6 +38,7 @@ Config_FeatureMessage::Config_FeatureMessage(const Events_ID theId, const void* myUseInput = false; myNestedFeatures = ""; myModal = false; + myIsTitleInToolbar = true; myIsApplyContinue = false; } @@ -161,6 +162,11 @@ bool Config_FeatureMessage::isAutoPreview() const return myIsAutoPreview; } +bool Config_FeatureMessage::isTitleInToolbar() const +{ + return myIsTitleInToolbar; +} + bool Config_FeatureMessage::isModal() const { return myModal; @@ -225,4 +231,9 @@ const std::string& Config_FeatureMessage::helpFileName() const void Config_FeatureMessage::setHelpFileName(const std::string& aName) { myHelpFile = aName; -} \ No newline at end of file +} + +void Config_FeatureMessage::setTitleInToolbar(bool theValue) +{ + myIsTitleInToolbar = theValue; +} diff --git a/src/Config/Config_FeatureMessage.h b/src/Config/Config_FeatureMessage.h index f4936056d..a027bec60 100644 --- a/src/Config/Config_FeatureMessage.h +++ b/src/Config/Config_FeatureMessage.h @@ -54,6 +54,7 @@ class Config_FeatureMessage : public Events_Message bool myInternal; ///setText(aText); - std::string aToolTip = Config_Translator::translate(anId, - getProperty(theFeatureNode, FEATURE_TOOLTIP)); + bool isTitleInToolbar = getBooleanAttribute(theFeatureNode, FEATURE_TITLE_IN_TOOLBAR, true); + outFeatureMessage->setTitleInToolbar(isTitleInToolbar); + //std::string aToolTip = Config_Translator::translate( + // anId, getProperty(theFeatureNode, FEATURE_TOOLTIP)); + //outFeatureMessage->setTooltip(aToolTip); outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON)); outFeatureMessage->setKeysequence(getProperty(theFeatureNode, FEATURE_KEYSEQUENCE)); std::string aHelpFile = getProperty(theFeatureNode, HELP_FILE); diff --git a/src/Config/Config_Keywords.h b/src/Config/Config_Keywords.h index 2d30633da..ca31903ec 100644 --- a/src/Config/Config_Keywords.h +++ b/src/Config/Config_Keywords.h @@ -83,6 +83,7 @@ const static char* FEATURE_DOC = WORKBENCH_DOC; const static char* FEATURE_MODAL = "modal"; const static char* FEATURE_APPLY_CONTINUE = "apply_continue"; const static char* FEATURE_AUTO_PREVIEW = "auto_preview"; +const static char* FEATURE_TITLE_IN_TOOLBAR = "titleInToolbar"; // NODE_VALIDATOR properties const static char* _PARAMETERS = "parameters"; diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 4a85e1c0c..cdbd9202b 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -800,7 +800,7 @@ QString wrapTextByWords(const QString& theValue, QWidget* theWidget, int n = aWords.count(); QString aLine; for (int i = 0; i < n; i++) { - QString aLineExt = aLine + " " + aWords[i]; + QString aLineExt = i == 0 ? aWords[i] : aLine + " " + aWords[i]; qreal anWidthNonExt = tfm.boundingRect(aLine).width(); qreal anWidthExt = tfm.boundingRect(aLineExt).width(); qreal aDeltaNonExt = fabs(anWidthNonExt-aGoldWidth); -- 2.30.2