1 /* 2 Copyright © 2022, Inochi2D Project 3 Distributed under the 2-Clause BSD License, see LICENSE file. 4 5 Authors: Luna Nielsen 6 */ 7 module creator.panels.timeline; 8 version(InExperimental) { 9 import creator.panels; 10 import i18n; 11 import inochi2d; 12 import bindbc.imgui; 13 import creator.widgets; 14 15 /** 16 The timeline panel 17 */ 18 class TimelinePanel : Panel { 19 private: 20 Animation* workingAnimation; 21 bool playing; 22 23 protected: 24 override 25 void onBeginUpdate() { 26 igPushStyleVar(ImGuiStyleVar.WindowPadding, ImVec2(0, 0)); 27 igPushStyleVar(ImGuiStyleVar.ChildBorderSize, 0); 28 super.onBeginUpdate(); 29 } 30 31 override 32 void onEndUpdate() { 33 super.onEndUpdate(); 34 igPopStyleVar(2); 35 } 36 37 override 38 void onUpdate() { 39 40 if (incBeginInnerToolbar(24)) { 41 if (incToolbarButton(playing ? "" : "", 64)) { 42 playing = !playing; 43 } 44 } 45 incEndInnerToolbar(); 46 } 47 48 public: 49 this() { 50 super("Timeline", _("Timeline"), false); 51 } 52 } 53 54 /** 55 Generate timeline panel 56 */ 57 mixin incPanel!TimelinePanel; 58 }