Merge pull request #656 from ispyisail/feature-last-used-style

Remember last-used shape/text style for new items this session
This commit is contained in:
Laurent Trinques
2026-08-08 14:22:52 +02:00
committed by GitHub
7 changed files with 192 additions and 1 deletions
@@ -19,6 +19,7 @@
#include "../diagram.h"
#include "../diagramcommands.h"
#include "../lastusedstyle.h"
#include "../qet.h"
#include "../qetapp.h"
#include "../utils/qetutils.h"
@@ -33,7 +34,10 @@
IndependentTextItem::IndependentTextItem() :
DiagramTextItem(nullptr)
{
setFont(QETApp::indiTextsItemFont());
//Start from the font last applied to a text item this session,
//falling back to the app-wide Preferences default otherwise.
setFont(LastUsedStyle::hasTextFont() ? LastUsedStyle::textFont()
: QETApp::indiTextsItemFont());
QSettings settings;
setRotation(settings.value("diagrameditor/independent_text_rotation", 0).toInt());
}