Changeset View
Changeset View
Standalone View
Standalone View
commands/tools/selection/kpToolImageSelectionTransparencyCommand.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 44 | kpToolImageSelectionTransparencyCommand::kpToolImageSelectionTransparencyCommand ( | |||
---|---|---|---|---|---|
47 | const kpImageSelectionTransparency &oldST, | 47 | const kpImageSelectionTransparency &oldST, | ||
48 | kpCommandEnvironment *environ) | 48 | kpCommandEnvironment *environ) | ||
49 | : kpNamedCommand (name, environ), | 49 | : kpNamedCommand (name, environ), | ||
50 | m_st (st), | 50 | m_st (st), | ||
51 | m_oldST (oldST) | 51 | m_oldST (oldST) | ||
52 | { | 52 | { | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | kpToolImageSelectionTransparencyCommand::~kpToolImageSelectionTransparencyCommand () | 55 | kpToolImageSelectionTransparencyCommand::~kpToolImageSelectionTransparencyCommand () = default; | ||
56 | { | | |||
57 | } | | |||
58 | 56 | | |||
59 | 57 | | |||
60 | // public virtual [base kpCommand] | 58 | // public virtual [base kpCommand] | ||
61 | kpCommandSize::SizeType kpToolImageSelectionTransparencyCommand::size () const | 59 | kpCommandSize::SizeType kpToolImageSelectionTransparencyCommand::size () const | ||
62 | { | 60 | { | ||
63 | return 0; | 61 | return 0; | ||
64 | } | 62 | } | ||
65 | 63 | | |||
66 | 64 | | |||
67 | // public virtual [base kpCommand] | 65 | // public virtual [base kpCommand] | ||
68 | void kpToolImageSelectionTransparencyCommand::execute () | 66 | void kpToolImageSelectionTransparencyCommand::execute () | ||
69 | { | 67 | { | ||
70 | qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::execute()"; | 68 | qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::execute()"; | ||
71 | 69 | | |||
72 | kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor); | 70 | kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor); | ||
73 | 71 | | |||
74 | environ ()->setImageSelectionTransparency (m_st, true/*force colour change*/); | 72 | environ ()->setImageSelectionTransparency (m_st, true/*force colour change*/); | ||
75 | 73 | | |||
76 | if (imageSelection ()) | 74 | if (imageSelection ()) { | ||
77 | imageSelection ()->setTransparency (m_st); | 75 | imageSelection ()->setTransparency (m_st); | ||
78 | } | 76 | } | ||
77 | } | ||||
79 | 78 | | |||
80 | // public virtual [base kpCommand] | 79 | // public virtual [base kpCommand] | ||
81 | void kpToolImageSelectionTransparencyCommand::unexecute () | 80 | void kpToolImageSelectionTransparencyCommand::unexecute () | ||
82 | { | 81 | { | ||
83 | qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::unexecute()"; | 82 | qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::unexecute()"; | ||
84 | 83 | | |||
85 | kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor); | 84 | kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor); | ||
86 | 85 | | |||
87 | environ ()->setImageSelectionTransparency (m_oldST, true/*force colour change*/); | 86 | environ ()->setImageSelectionTransparency (m_oldST, true/*force colour change*/); | ||
88 | 87 | | |||
89 | if (imageSelection ()) | 88 | if (imageSelection ()) { | ||
90 | imageSelection ()->setTransparency (m_oldST); | 89 | imageSelection ()->setTransparency (m_oldST); | ||
91 | } | 90 | } | ||
91 | } | ||||
92 | 92 | |