- Added main application class `SpriteEditorApp` with layout setup. - Created menu bar with placeholder options. - Implemented `BottomToolbarView`, `LeftSidebarView`, `MainEditorView`, `RightSidebarView` with basic UI elements. - Added dialog classes for `ExportSettingsDialog` and `FlipbookCreatorDialog` to manage export settings and flipbook creation. - Introduced support for loading and displaying images in the flipbook creator. - Established a structure for handling sprite sheet composition and preview rendering.
67 lines
1.8 KiB
Python
67 lines
1.8 KiB
Python
import tkinter as tk
|
|
from tkinter import ttk
|
|
|
|
from views import (
|
|
BottomToolbarView,
|
|
FlipbookCreatorDialog,
|
|
LeftSidebarView,
|
|
MainEditorView,
|
|
RightSidebarView,
|
|
create_menu_bar,
|
|
)
|
|
|
|
|
|
class SpriteEditorApp:
|
|
def __init__(self, root: tk.Tk) -> None:
|
|
self.root = root
|
|
self.root.title("Sprite Editor (Placeholder)")
|
|
self.root.geometry("1200x750")
|
|
|
|
create_menu_bar(self.root, on_open_flipbook_creator=self._open_flipbook_creator)
|
|
self._create_layout()
|
|
|
|
def _create_layout(self) -> None:
|
|
container = ttk.Frame(self.root, padding=6)
|
|
container.pack(fill="both", expand=True)
|
|
|
|
vertical_panes = tk.PanedWindow(
|
|
container,
|
|
orient=tk.VERTICAL,
|
|
sashrelief=tk.RAISED,
|
|
sashwidth=6,
|
|
)
|
|
vertical_panes.pack(fill="both", expand=True)
|
|
|
|
horizontal_panes = tk.PanedWindow(
|
|
vertical_panes,
|
|
orient=tk.HORIZONTAL,
|
|
sashrelief=tk.RAISED,
|
|
sashwidth=6,
|
|
)
|
|
|
|
left_sidebar = LeftSidebarView(horizontal_panes)
|
|
main_editor = MainEditorView(horizontal_panes)
|
|
right_sidebar = RightSidebarView(horizontal_panes)
|
|
bottom_toolbar = BottomToolbarView(vertical_panes)
|
|
|
|
horizontal_panes.add(left_sidebar, minsize=160, width=220)
|
|
horizontal_panes.add(main_editor, minsize=400)
|
|
horizontal_panes.add(right_sidebar, minsize=160, width=220)
|
|
|
|
vertical_panes.add(horizontal_panes, minsize=280, stretch="always")
|
|
vertical_panes.add(bottom_toolbar, minsize=70, height=140)
|
|
|
|
def _open_flipbook_creator(self) -> None:
|
|
dialog = FlipbookCreatorDialog(self.root)
|
|
dialog.focus()
|
|
|
|
|
|
def main() -> None:
|
|
root = tk.Tk()
|
|
SpriteEditorApp(root)
|
|
root.mainloop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|