r24728 by craig - #16636: Add text style actions to menu to allow activating from

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 3 15:03:56 UTC 2021


Author: craig
Date: Sun Oct  3 15:03:56 2021
New Revision: 24728

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24728
Log:
#16636: Add text style actions to menu to allow activating from
shortcuts

Modified:
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/appmodehelper.cpp
    trunk/Scribus/scribus/appmodehelper.h
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24728&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp	(original)
+++ trunk/Scribus/scribus/actionmanager.cpp	Sun Oct  3 15:03:56 2021
@@ -318,11 +318,11 @@
 	name = "alignForced";
 	scrActions->insert(name, new ScrAction(ScrAction::DataInt, QString(), QString(), "", defaultKey(name), mainWindow, 4));
 
-	(*scrActions)["alignLeft"]->setToggleAction(true);
-	(*scrActions)["alignCenter"]->setToggleAction(true);
-	(*scrActions)["alignRight"]->setToggleAction(true);
-	(*scrActions)["alignBlock"]->setToggleAction(true);
-	(*scrActions)["alignForced"]->setToggleAction(true);
+//	(*scrActions)["alignLeft"]->setToggleAction(true);
+//	(*scrActions)["alignCenter"]->setToggleAction(true);
+//	(*scrActions)["alignRight"]->setToggleAction(true);
+//	(*scrActions)["alignBlock"]->setToggleAction(true);
+//	(*scrActions)["alignForced"]->setToggleAction(true);
 
 	connect( (*scrActions)["alignLeft"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
 	connect( (*scrActions)["alignCenter"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24728&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp	(original)
+++ trunk/Scribus/scribus/appmodehelper.cpp	Sun Oct  3 15:03:56 2021
@@ -531,6 +531,7 @@
 			(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(false);
 			(*a_scrActions)["toolsRotate"]->setEnabled(false);
 			(*a_scrActions)["toolsCopyProperties"]->setEnabled(false);
+			enableTextStyleActions(false);
 			break;
 		case PageItem::ImageFrame: //Image Frame
 			(*a_scrActions)["fileImportAppendText"]->setEnabled(false);
@@ -621,6 +622,7 @@
 			(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(true);
 			(*a_scrActions)["insertSampleText"]->setEnabled(true);
 			//scrMenuMgr->setMenuEnabled("InsertMark",true);
+			enableTextStyleActions(true);
 
 			if ((currItem->nextInChain() != nullptr) || (currItem->prevInChain() != nullptr))
 			{
@@ -1790,6 +1792,7 @@
 void AppModeHelper::enableTextActions(bool enabled, const QString& fontName)
 {
 	(*a_scrActions)["insertGlyph"]->setEnabled(enabled);
+
 	a_actMgr->enableUnicodeActions(a_scrActions, enabled, fontName);
 	if (!enabled)
 	{
@@ -1800,6 +1803,25 @@
 		(*a_scrActions)["insertMarkNote"]->setEnabled(false);
 		(*a_scrActions)["editMark"]->setEnabled(false);
 	}
+}
+
+void AppModeHelper::enableTextStyleActions(bool enabled)
+{
+	(*a_scrActions)["alignLeft"]->setEnabled(enabled);
+	(*a_scrActions)["alignCenter"]->setEnabled(enabled);
+	(*a_scrActions)["alignRight"]->setEnabled(enabled);
+	(*a_scrActions)["alignBlock"]->setEnabled(enabled);
+	(*a_scrActions)["alignForced"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectNormal"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectUnderline"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectUnderlineWords"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectStrikeThrough"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectAllCaps"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectSmallCaps"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectSuperscript"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectSubscript"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectOutline"]->setEnabled(enabled);
+	(*a_scrActions)["typeEffectShadow"]->setEnabled(enabled);
 }
 
 void AppModeHelper::setStartupActionsEnabled(bool enabled)

Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24728&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h	(original)
+++ trunk/Scribus/scribus/appmodehelper.h	Sun Oct  3 15:03:56 2021
@@ -57,6 +57,7 @@
 		void setPreviewMode(bool b);
 		//! \brief enable or disable the unicode actions and their menus
 		void enableTextActions(bool enabled, const QString& fontName=QString());
+		void enableTextStyleActions(bool enabled);
 		void setStartupActionsEnabled(bool enabled);
 
 

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24728&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sun Oct  3 15:03:56 2021
@@ -1039,7 +1039,29 @@
 	scrMenuMgr->addMenuItemString("itemWeld", "Weld");
 	scrMenuMgr->addMenuItemString("itemsUnWeld", "Weld");
 	scrMenuMgr->addMenuItemString("itemEditWeld", "Weld");
-	scrMenuMgr->addMenuItemString("editMark", "Item");
+
+	scrMenuMgr->createMenu("Marks", tr("Marks"), "Item");
+	scrMenuMgr->addMenuItemString("Marks", "Item");
+	scrMenuMgr->addMenuItemString("editMark", "Marks");
+
+	scrMenuMgr->createMenu("TextFeatures", tr("Text Features", "Item"));
+	scrMenuMgr->addMenuItemString("TextFeatures", "Item");
+	scrMenuMgr->addMenuItemString("alignLeft", "TextFeatures");
+	scrMenuMgr->addMenuItemString("alignCenter", "TextFeatures");
+	scrMenuMgr->addMenuItemString("alignRight", "TextFeatures");
+	scrMenuMgr->addMenuItemString("alignBlock", "TextFeatures");
+	scrMenuMgr->addMenuItemString("alignForced", "TextFeatures");
+	scrMenuMgr->addMenuItemString("SEPARATOR", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectNormal", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectUnderline", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectUnderlineWords", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectStrikeThrough", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectAllCaps", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectSmallCaps", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectSuperscript", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectSubscript", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectOutline", "TextFeatures");
+	scrMenuMgr->addMenuItemString("typeEffectShadow", "TextFeatures");
 
 	//Insert menu
 	scrMenuMgr->createMenu("Insert", ActionManager::defaultMenuNameEntryTranslated("Insert"));




More information about the scribus-commit mailing list