dimasmon 0.2.3

dimasmon - a monitoring tool for DiMAS
// Copyright © 2024 Stephan Kunz

import { AboutSlint, Button, StandardButton, TabWidget } from "std-widgets.slint";

export component MainWindow inherits Window {
    title: "DiMAS Monitor";
    preferred-width: 1280px;
    preferred-height: 720px;
    min-width: 640px;
    min-height: 480px;

    splash_popup := PopupWindow {
        height: 150px; width: 250px;
        x: 0.5*(root.width - 250px); 
        y: 0.5*(root.height - 150px);
        
        Rectangle {
            background: #2e053d;

            AboutSlint {
            }
        }
    }

    VerticalLayout {
        width: 100%;
        height: 100%;

        // TopMenu
        top_menu := Rectangle {
            height: 44px;
            background: gray;

            Button {
                text: "??";
                clicked => { splash_popup.show(); }
            }    
        }

        HorizontalLayout {
            // LeftMenu
            left_menu := TabWidget {
                width: 20%;

                Tab {
                    title: "MenuTab1";
                    Rectangle {
                        background: darkgray;
                    }
                }
            }

            VerticalLayout {
                HorizontalLayout {
                    // MainArea
                    main_area := TabWidget {
                        Tab {
                            title: "MainTab1";
                            Rectangle {
                                background: white;
                            }
                        }
                        Tab {
                            title: "MainTab2";
                            Rectangle {
                                background: whitesmoke;
                            }
                        }
                    }
                    // RightArea
                    right_area := TabWidget {
                        width: 0%;
                        visible: false;

                        Tab {
                            title: "RightTab1";
                            Rectangle {
                                // background: cyan;
                            }
                        }
                    }
                }

                // BottomArea
                bottom_area := TabWidget {
                    height: 0%;
                    visible: false;

                    Tab {
                        title: "BottomTab1";
                        Rectangle {
                            background: gray;
                        }
                    }
                }
            }
        }

        // StatusLine
        status_line := Rectangle {
            height: 30px;
            background: lightgray;
        }
    }
}