| 18 | // Internal dependancies: Main, Logger, LoginScreen, SystemsScreen, ExitParser, Apps, API |
| 19 | |
| 20 | public class Desktop { |
| 21 | |
| 22 | public static Boolean useWallpaper = true; |
| 23 | public static String desktopWallpaper = "/resources/wallpapers/PiXElos_Mountain_Landscape_by_Giulia_Filippini_and_David_Refoua.png"; |
| 24 | public static Color desktopColor = Color.web("#003333"); |
| 25 | public static String desktopFont = "/resources/fonts/Roboto-Regular.ttf"; |
| 26 | public static Integer desktopFontSize = 12; |
| 27 | |
| 28 | public static String taskbarMainColor = "-fx-background-color: rgba(35, 35, 37, 1);"; |
| 29 | public static String taskbarFontColor = "-fx-text-fill: rgba(211, 211, 211, 1);"; |
| 30 | |
| 31 | public static Color taskbarMainColor_c = Color.web("#232325"); |
| 32 | public static Color taskbarFontColor_c = Color.web("#d3d3d3"); |
| 33 | |
| 34 | public static Pane main_root; |
| 35 | public static Scene main_scene; |
| 36 | public static HBox desktop_taskbar; |
| 37 | public static HBox main_appbar; |
| 38 | public static HBox main_utilbar; |
| 39 | public static Runnable startMenu = null; |
| 40 | public static Runnable startMenuClose = null; |
| 41 | public static Boolean startMenuIsOpen = false; |
| 42 | public static Boolean isOpen = false; |
| 43 | |
| 44 | private static String system_systemLocation; |
| 45 | |
| 46 | public static void start() { |
| 47 | start(Main.defaultSystem); |
| 48 | } |
| 49 | |
| 50 | public static void start(String systemLocation) { |
| 51 | |
| 52 | system_systemLocation = systemLocation; |
| 53 | |
| 54 | // we use a default pane without layout such as HBox, VBox etc. |
| 55 | final Pane root = new Pane(); |
| 56 | main_root = root; |
| 57 | final BorderPane root_desktop = new BorderPane(); |
| 58 | root.setPrefSize(800, 600); // Set default size of the window: (Width, height) |
| 59 | root.getChildren().add(root_desktop); |
| 60 | root_desktop.prefWidthProperty().bind(root.widthProperty()); // Fit root_desktop to root (yes, both Pane's are required.) |
| 61 | root_desktop.prefHeightProperty().bind(root.heightProperty()); |
| 62 | root_desktop.setBackground(Background.EMPTY); // Makes the background color transparent, else the background fills with color. |
| 63 | root.setBackground(Background.EMPTY); |
| 64 | |
| 65 | //TaskBar |
| 66 | HBox task_bar = new HBox(); |
| 67 | task_bar.getStylesheets().add("config.css"); |
| 68 | task_bar.setStyle(Desktop.taskbarMainColor + "-fx-border-color: rgb(39, 39, 40)"); |
| 69 | root_desktop.setBottom(task_bar); |
| 70 | Desktop.desktop_taskbar = task_bar; |
| 71 | //Start |
| 72 | Button start_button = new Button(" PiXEl |"); |
| 73 | start_button.setFont(loadFont(Desktop.desktopFont, Desktop.desktopFontSize)); |
| 74 | start_button.setStyle(Desktop.taskbarFontColor); |
| 75 | task_bar.getChildren().add(start_button); |
| 76 | start_button.setOnAction(open -> { |
| 77 | if (Desktop.startMenuIsOpen) { |
nothing calls this directly
no outgoing calls
no test coverage detected