From: mpv Date: Mon, 22 Apr 2019 07:18:02 +0000 (+0300) Subject: Cosmetic changes X-Git-Tag: VEDF2019Lot4~149 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a29bd0924da73593031216a4929a4b42954af814;p=modules%2Fshaper.git Cosmetic changes --- 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);