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