summaryrefslogtreecommitdiff
path: root/src/imgui_ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imgui_ui.cpp')
-rw-r--r--src/imgui_ui.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/imgui_ui.cpp b/src/imgui_ui.cpp
index 0a7f310..380aaf2 100644
--- a/src/imgui_ui.cpp
+++ b/src/imgui_ui.cpp
@@ -1,19 +1,5 @@
-
-#include "imgui_internal_widgets.h"
-
-#include "imgui_ops.h"
-
-#include "imgui_helper.cpp"
-
-#include "imgui_ui_properties.cpp"
-#include "imgui_ui_timeline.cpp"
-#include "imgui_ui_viewport.cpp"
-
-#if DEBUG
-#include "imgui_ui_debug.cpp"
-#endif
-#if STABLE
-#include "imgui_ui_stable_diffusion.cpp"
+#if SPECIAL
+#include "main.h"
#endif
static void
@@ -21,6 +7,7 @@ ImGui_File(project_data *File, project_state *State, memory *Memory, ImGuiIO io,
sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray)
{
ImGui::Begin("Files");
+ ImGui::Text("%s: %hu", "Layers", File->Layer_Count);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
@@ -421,7 +408,14 @@ ImGui_ProcessInputs(project_data *File, project_state *State, ui *UI, memory *Me
State->Tool = tool_brush;
}
if (ImGui::IsKeyPressed(ImGuiKey_D)) {
- State->Tool = tool_pen;
+ if (io.KeyShift && State->Interact_Active == interact_type_none) {
+ History_Entry_Commit(Memory, "Duplicate layers");
+ v2 Offset = V2(State->Interact_Dup_Previous[0], State->Interact_Dup_Previous[1]);
+ Project_Layer_Duplicate(File, State, Memory, Sorted.CompArray, Sorted.LayerArray, Offset, 0);
+ History_Entry_End(Memory);
+ } else {
+ State->Tool = tool_pen;
+ }
}
// NOTE(fox): File data not tracked on undo tree!
if (ImGui::IsKeyPressed(ImGuiKey_N)) {
@@ -653,6 +647,10 @@ ImGui_Menu(project_data *File, project_state *State, ui *UI, memory *Memory, ImG
}
if (ImGui::BeginMenu("Window"))
{
+ if (ImGui::Selectable("Standard view", UI->Mode == 0))
+ UI->Mode = 0;
+ if (ImGui::Selectable("Vector view", UI->Mode == 1))
+ UI->Mode = 1;
#if STABLE
if (ImGui::Selectable("Stable Diffusion tools", UI->StableEnabled))
UI->StableEnabled ^= 1;