[studio,nostalgia/gfx/studio/tilesheet] Fix copy/cut/paste enablement when there is no selection
All checks were successful
Build / build (push) Successful in 2m2s
All checks were successful
Build / build (push) Successful in 2m2s
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
* Fix file deletion to close file even if not active
|
||||
* Fix file copy to work when creating a copy with the name of a previously
|
||||
deleted file
|
||||
* Fix copy/cut/paste enablement when there is no selection
|
||||
* Make file picker popup accept on double click of a file
|
||||
* PaletteEditor: Add RGB key shortcuts for focusing color channels
|
||||
* PaletteEditor: Add color preview to color editor
|
||||
|
@ -192,6 +192,8 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key const key, bool const do
|
||||
}
|
||||
|
||||
void TileSheetEditorImGui::draw(studio::Context&) noexcept {
|
||||
setCopyEnabled(m_model.hasSelection());
|
||||
setCutEnabled(m_model.hasSelection());
|
||||
if (ig::mainWinHasFocus() && m_tool == TileSheetTool::Select) {
|
||||
if (ImGui::IsKeyDown(ImGuiKey_ModCtrl) && !m_palPathFocused) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_A)) {
|
||||
|
@ -315,6 +315,10 @@ void TileSheetEditorModel::clearSelection() noexcept {
|
||||
m_selection.reset();
|
||||
}
|
||||
|
||||
bool TileSheetEditorModel::hasSelection() const noexcept {
|
||||
return m_selection.has_value();
|
||||
}
|
||||
|
||||
bool TileSheetEditorModel::updated() const noexcept {
|
||||
return m_updated;
|
||||
}
|
||||
|
@ -118,6 +118,9 @@ class TileSheetEditorModel final: public ox::SignalHandler {
|
||||
|
||||
void clearSelection() noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
bool hasSelection() const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
bool updated() const noexcept;
|
||||
|
||||
|
@ -72,8 +72,10 @@ bool BaseEditor::exportable() const noexcept {
|
||||
}
|
||||
|
||||
void BaseEditor::setCutEnabled(bool v) {
|
||||
m_cutEnabled = v;
|
||||
cutEnabledChanged.emit(v);
|
||||
if (m_cutEnabled != v) {
|
||||
m_cutEnabled = v;
|
||||
cutEnabledChanged.emit(v);
|
||||
}
|
||||
}
|
||||
|
||||
bool BaseEditor::cutEnabled() const noexcept {
|
||||
@ -81,8 +83,10 @@ bool BaseEditor::cutEnabled() const noexcept {
|
||||
}
|
||||
|
||||
void BaseEditor::setCopyEnabled(bool v) {
|
||||
m_copyEnabled = v;
|
||||
copyEnabledChanged.emit(v);
|
||||
if (m_copyEnabled != v) {
|
||||
m_copyEnabled = v;
|
||||
copyEnabledChanged.emit(v);
|
||||
}
|
||||
}
|
||||
|
||||
bool BaseEditor::copyEnabled() const noexcept {
|
||||
@ -90,8 +94,10 @@ bool BaseEditor::copyEnabled() const noexcept {
|
||||
}
|
||||
|
||||
void BaseEditor::setPasteEnabled(bool v) {
|
||||
m_pasteEnabled = v;
|
||||
pasteEnabledChanged.emit(v);
|
||||
if (m_pasteEnabled != v) {
|
||||
m_pasteEnabled = v;
|
||||
pasteEnabledChanged.emit(v);
|
||||
}
|
||||
}
|
||||
|
||||
bool BaseEditor::pasteEnabled() const noexcept {
|
||||
|
Reference in New Issue
Block a user