From d0c683eb644c091e10b973bb6d34d8befa7e74a0 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Sat, 19 Oct 2019 12:40:52 +0300 Subject: [PATCH] UI fixes & misc --- .../Controllers/GameModeController.java | 121 +++++++++- .../logiled/Controllers/MainController.java | 7 +- src/main/resources/GameModePane.fxml | 202 ++++++++--------- src/main/resources/KeysLedsPane.fxml | 208 +++++++++--------- src/main/resources/Main.fxml | 139 ++++-------- src/main/resources/light.css | 166 +++++++------- 6 files changed, 467 insertions(+), 376 deletions(-) diff --git a/src/main/java/logiled/Controllers/GameModeController.java b/src/main/java/logiled/Controllers/GameModeController.java index 097dfe5..7eba910 100644 --- a/src/main/java/logiled/Controllers/GameModeController.java +++ b/src/main/java/logiled/Controllers/GameModeController.java @@ -12,6 +12,18 @@ import java.util.*; public class GameModeController implements Initializable { + @FXML + private ToggleButton + k_esc, k_f1, k_f2, k_f3, k_f4, k_f5, k_f6, k_f7, k_f8, k_f9, k_f10, k_f11, k_f12, + k_1, k_2, k_3, k_4, k_5, k_6, k_7, k_8, k_9, k_0, k_dash, k_equal, k_backspace, + k_tab, k_q, k_w, k_e, k_r, k_t, k_y, k_u, k_i, k_o, k_p, k_bracket_open, k_bracket_close, k_backslash, + k_caps, k_a, k_s, k_d, k_f, k_g, k_h, k_j, k_k, k_l, k_semicolon, k_quotation, k_enter, + k_l_shift, k_z, k_x, k_c, k_v, k_b, k_n, k_m, k_comma, k_dot, k_shash, k_r_shift, + k_l_ctrl, k_win, k_l_alt, k_space, k_r_alt, k_fn, k_menu, k_r_ctrl, + k_prtscr, k_scrl, k_pause, k_tilde, k_ins, k_home, k_pg_up, k_del, k_pg_dn, + k_arr_up, k_arr_down, k_arr_left, k_arr_right, k_end, + k_num, k_num_slash, k_num_asterisk, k_num_minus, k_num_9, k_num_8, k_num_7, k_num_6, k_num_5, k_num_4, k_num_3, k_num_2, k_num_1, k_num_0, k_num_period, k_num_enter, k_num_plus; + @FXML private Button resetBtn; @@ -20,9 +32,116 @@ public class GameModeController implements Initializable { @Override public void initialize(URL url, ResourceBundle resourceBundle) { keySet = new ArrayList<>(); + + HashMap kbrdMap = new HashMap<>(); + kbrdMap.put("k_esc", k_esc); + kbrdMap.put("k_f1", k_f1); + kbrdMap.put("k_f2", k_f2); + kbrdMap.put("k_f3", k_f3); + kbrdMap.put("k_f4", k_f4); + kbrdMap.put("k_f5", k_f5); + kbrdMap.put("k_f6", k_f6); + kbrdMap.put("k_f7", k_f7); + kbrdMap.put("k_f8", k_f8); + kbrdMap.put("k_f9", k_f9); + kbrdMap.put("k_f10", k_f10); + kbrdMap.put("k_f11", k_f11); + kbrdMap.put("k_f12", k_f12); + kbrdMap.put("k_1", k_1); + kbrdMap.put("k_2", k_2); + kbrdMap.put("k_3", k_3); + kbrdMap.put("k_4", k_4); + kbrdMap.put("k_5", k_5); + kbrdMap.put("k_6", k_6); + kbrdMap.put("k_7", k_7); + kbrdMap.put("k_8", k_8); + kbrdMap.put("k_9", k_9); + kbrdMap.put("k_0", k_0); + kbrdMap.put("k_dash", k_dash); + kbrdMap.put("k_equal", k_equal); + kbrdMap.put("k_backspace", k_backspace); + kbrdMap.put("k_tab", k_tab); + kbrdMap.put("k_q", k_q); + kbrdMap.put("k_w", k_w); + kbrdMap.put("k_e", k_e); + kbrdMap.put("k_r", k_r); + kbrdMap.put("k_t", k_t); + kbrdMap.put("k_y", k_y); + kbrdMap.put("k_u", k_u); + kbrdMap.put("k_i", k_i); + kbrdMap.put("k_o", k_o); + kbrdMap.put("k_p", k_p); + kbrdMap.put("k_bracket_open", k_bracket_open); + kbrdMap.put("k_bracket_close", k_bracket_close); + kbrdMap.put("k_backslash", k_backslash); + kbrdMap.put("k_caps", k_caps); + kbrdMap.put("k_a", k_a); + kbrdMap.put("k_s", k_s); + kbrdMap.put("k_d", k_d); + kbrdMap.put("k_f", k_f); + kbrdMap.put("k_g", k_g); + kbrdMap.put("k_h", k_h); + kbrdMap.put("k_j", k_j); + kbrdMap.put("k_k", k_k); + kbrdMap.put("k_l", k_l); + kbrdMap.put("k_semicolon", k_semicolon); + kbrdMap.put("k_quotation", k_quotation); + kbrdMap.put("k_enter", k_enter); + kbrdMap.put("k_l_shift", k_l_shift); + kbrdMap.put("k_z", k_z); + kbrdMap.put("k_x", k_x); + kbrdMap.put("k_c", k_c); + kbrdMap.put("k_v", k_v); + kbrdMap.put("k_b", k_b); + kbrdMap.put("k_n", k_n); + kbrdMap.put("k_m", k_m); + kbrdMap.put("k_comma", k_comma); + kbrdMap.put("k_dot", k_dot); + kbrdMap.put("k_shash", k_shash); + kbrdMap.put("k_r_shift", k_r_shift); + kbrdMap.put("k_l_ctrl", k_l_ctrl); + kbrdMap.put("k_win", k_win); + kbrdMap.put("k_l_alt", k_l_alt); + kbrdMap.put("k_space", k_space); + kbrdMap.put("k_r_alt", k_r_alt); + kbrdMap.put("k_fn", k_fn); + kbrdMap.put("k_menu", k_menu); + kbrdMap.put("k_r_ctrl", k_r_ctrl); + kbrdMap.put("k_prtscr", k_prtscr); + kbrdMap.put("k_scrl", k_scrl); + kbrdMap.put("k_pause", k_pause); + kbrdMap.put("k_tilde", k_tilde); + kbrdMap.put("k_ins", k_ins); + kbrdMap.put("k_home", k_home); + kbrdMap.put("k_pg_up", k_pg_up); + kbrdMap.put("k_del", k_del); + kbrdMap.put("k_pg_dn", k_pg_dn); + kbrdMap.put("k_arr_up", k_arr_up); + kbrdMap.put("k_arr_down", k_arr_down); + kbrdMap.put("k_arr_left", k_arr_left); + kbrdMap.put("k_arr_right", k_arr_right); + kbrdMap.put("k_end", k_end); + kbrdMap.put("k_num", k_num); + kbrdMap.put("k_num_slash", k_num_slash); + kbrdMap.put("k_num_asterisk", k_num_asterisk); + kbrdMap.put("k_num_minus", k_num_minus); + kbrdMap.put("k_num_9", k_num_9); + kbrdMap.put("k_num_8", k_num_8); + kbrdMap.put("k_num_7", k_num_7); + kbrdMap.put("k_num_6", k_num_6); + kbrdMap.put("k_num_5", k_num_5); + kbrdMap.put("k_num_4", k_num_4); + kbrdMap.put("k_num_3", k_num_3); + kbrdMap.put("k_num_2", k_num_2); + kbrdMap.put("k_num_1", k_num_1); + kbrdMap.put("k_num_0", k_num_0); + kbrdMap.put("k_num_period", k_num_period); + kbrdMap.put("k_num_enter", k_num_enter); + kbrdMap.put("k_num_plus", k_num_plus); + resetBtn.setOnAction(ActionEvent -> { for (String keyID : keySet) - ((ToggleButton) resetBtn.getScene().lookup("#"+keyID)).setSelected(false); + kbrdMap.get(keyID).setSelected(false); keySet.clear(); }); } diff --git a/src/main/java/logiled/Controllers/MainController.java b/src/main/java/logiled/Controllers/MainController.java index 8ed0632..4d3268f 100644 --- a/src/main/java/logiled/Controllers/MainController.java +++ b/src/main/java/logiled/Controllers/MainController.java @@ -39,14 +39,11 @@ public class MainController implements Initializable { private Tab KeyLedTab, EffectsTab; */ @FXML - private Button applyBtn, openBtn, saveBtn, saveAsBtn; + private Button applyBtn, openBtn, saveBtn, saveAsBtn, aboutBtn; @FXML private Label infoLbl; - @FXML - private MenuItem aboutMenuItem; - private ResourceBundle rb; private String recentPath; @@ -56,7 +53,7 @@ public class MainController implements Initializable { public void initialize(URL url, ResourceBundle resourceBundle) { this.rb = resourceBundle; - aboutMenuItem.setOnAction(actionEvent -> new AboutWindow()); + aboutBtn.setOnAction(actionEvent -> new AboutWindow()); MessagesConsumer.getInstance().setInstance(infoLbl); MessagesConsumer.getInstance().start(); diff --git a/src/main/resources/GameModePane.fxml b/src/main/resources/GameModePane.fxml index bbafb2e..61b5979 100644 --- a/src/main/resources/GameModePane.fxml +++ b/src/main/resources/GameModePane.fxml @@ -32,86 +32,86 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -123,32 +123,32 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + @@ -160,32 +160,32 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + @@ -200,19 +200,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -220,25 +220,25 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + - + @@ -248,13 +248,13 @@ - + - - + + @@ -269,15 +269,15 @@ - + - - - + + + @@ -305,27 +305,27 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/main/resources/KeysLedsPane.fxml b/src/main/resources/KeysLedsPane.fxml index c0cdc65..95477b7 100644 --- a/src/main/resources/KeysLedsPane.fxml +++ b/src/main/resources/KeysLedsPane.fxml @@ -45,86 +45,86 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -159,4 +68,52 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/light.css b/src/main/resources/light.css index 41a9468..39505fd 100644 --- a/src/main/resources/light.css +++ b/src/main/resources/light.css @@ -2,59 +2,126 @@ -fx-background: #ebebeb; } /* -======================== Buttons =====================- */ +.button SVGPath{ + -fx-fill: #141414; +} .button, .toggle-button { -fx-background-color: #fefefe; - -fx-border-color: #fefefe; - -fx-border-radius: 3; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-background-radius: 2; + -fx-border-color: #bebebe; /* #d7fecf; */ + -fx-border-radius: 2; -fx-border-width: 2; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #cccccc, 2, 0, 0, 0); + //-fx-effect: dropshadow(three-pass-box, #dadada, 2, 0, 0, 0); } .button:hover, .choice-box:hover, .button:focused:hover, .choice-box:focused:hover, .toggle-button:hover, .toggle-button:focused:hover{ -fx-background-color: #fefefe; - -fx-border-color: #00caca; - -fx-border-radius: 3; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-background-radius: 2; + -fx-border-color: #009bca; + -fx-border-radius: 2; -fx-border-width: 2; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #00caca, 2, 0, 0, 0); + //-fx-effect: dropshadow(three-pass-box, #009bca, 2, 0, 0, 0); } .button:focused, .choice-box:focused, .toggle-button:focused{ - -fx-background-color: #cccccc; - -fx-border-color: #cccccc; - -fx-border-radius: 3; + -fx-background-color: #dadada; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-background-radius: 2; + -fx-border-color: #8f8f8f; + -fx-border-radius: 2; -fx-border-width: 2; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #cccccc, 2, 0, 0, 0); + //-fx-effect: dropshadow(three-pass-box, #dadada, 2, 0, 0, 0); } .button:pressed, .button:pressed:hover, .toggle-button:pressed, .toggle-button:pressed:hover{ -fx-background-color: #fefefe; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-background-radius: 2; -fx-border-color: #e82382; - -fx-border-radius: 3; + -fx-border-radius: 2; -fx-border-width: 2; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #e82382, 2, 0, 0, 0); + //-fx-effect: dropshadow(three-pass-box, #e82382, 2, 0, 0, 0); } .toggle-button:selected, .toggle-button:selected:hover{ -fx-background-color: #e1feeb; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-background-radius: 2; -fx-border-color: #ccfed1; - -fx-border-radius: 3; + -fx-border-radius: 2; -fx-border-width: 2; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #cccccc, 2, 0, 0, 0); + //-fx-effect: dropshadow(three-pass-box, #dadada, 2, 0, 0, 0); +} +/* -======================== Buttons keys =====================- */ +.button_keycap, .toggle-button_keycap { + -fx-background-color: #fefefe; + -fx-background-radius: 8; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #cfcfcf; + -fx-border-radius: 8; + -fx-border-width: 1; + -fx-text-fill: #2c2c2c; + -fx-effect: dropshadow(three-pass-box, #8f8f8f, 1, 0, 0, 0); +} +.button_keycap:hover, .button_keycap:focused:hover, .toggle-button_keycap:hover, .toggle-button_keycap:focused:hover{ + -fx-background-color: #fefefe; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #009bca; + -fx-border-radius: 8; + -fx-background-radius: 8; + -fx-border-width: 1; + -fx-text-fill: #2c2c2c; + -fx-effect: dropshadow(three-pass-box, #009bca, 2, 0, 0, 0); +} +.button_keycap:focused, .toggle-button_keycap:focused{ + -fx-background-color: #dadada; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #8f8f8f; + -fx-border-radius: 8; + -fx-background-radius: 8; + -fx-border-width: 1; + -fx-text-fill: #2c2c2c; + -fx-effect: dropshadow(three-pass-box, #8f8f8f, 1, 0, 0, 0); +} + +.button_keycap:pressed, .button_keycap:pressed:hover, .toggle-button_keycap:pressed, .toggle-button_keycap:pressed:hover{ + -fx-background-color: #fefefe; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #e82382; + -fx-border-radius: 8; + -fx-background-radius: 8; + -fx-border-width: 1; + -fx-text-fill: #2c2c2c; + -fx-effect: dropshadow(three-pass-box, #e82382, 2, 0, 0, 0); +} + +.toggle-button_keycap:selected, .toggle-button_keycap:selected:hover{ + -fx-background-color: #e1feeb; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #ccfed1; + -fx-border-radius: 8; + -fx-background-radius: 8; + -fx-border-width: 1; + -fx-text-fill: #2c2c2c; + -fx-effect: none; } .always_off_button:disabled, .always_off_button:disabled:selected { -fx-opacity: 1.0; -fx-background-color: #fee9f8; - -fx-border-color: #fed6fe; - -fx-border-radius: 3; - -fx-border-width: 2; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #f1cbf1; + -fx-border-radius: 8; + -fx-background-radius: 8; + -fx-border-width: 1; -fx-text-fill: #2c2c2c; - -fx-effect: dropshadow(three-pass-box, #cccccc, 2, 0, 0, 0); + -fx-effect: dropshadow(three-pass-box, #f1cbf1, 1, 0, 0, 0); } - /* -======================== TextArea =====================- */ .text-area{ -fx-background-color: transparent; @@ -174,55 +241,6 @@ .tab-pane > .tab-header-area > .headers-region > .tab { -fx-padding: 10; } -/* -=========================== TABLE ======================- */ -.table-view { - -fx-background-color: #fefefe; - -fx-background-image: url(app_logo.png); - -fx-background-position: center; - -fx-background-repeat: no-repeat; - -fx-background-radius: 3; - -fx-border-color: #06b9bb; - -fx-border-radius: 3; - -fx-border-width: 2; -} -.table-view .arrow { - -fx-mark-color: #2c2c2c ; -} -.table-view .column-header { - -fx-background-color: transparent; - -fx-border-width: 0 1 2 0; - -fx-border-color: #b0b0b0; -} -.table-view .column-header-background .label{ - -fx-background-color: transparent; - -fx-text-fill: #2c2c2c; -} -.table-view .column-header-background, .table-view .filler{ - -fx-background-color: #fefefe; -} - -.table-view .table-cell{ - -fx-text-fill: #2c2c2c; -} -.table-row-cell, .table-row-cell:filled:selected, .table-row-cell:selected{ - -fx-background-color: -fx-table-cell-border-color, #d3fffd; - -fx-background-insets: 0, 0 0 1 0; - -fx-padding: 0.0em; /* 0 */ - -fx-table-cell-border-color: #b0b0b0; -} -.table-row-cell .text, .table-row-cell:odd .text { - -fx-fill: #2c2c2c; -} -.table-row-cell:filled:selected .text, .table-row-cell:odd:filled:selected .text{ - -fx-fill: #2c2c2c; - -fx-font-weight: bold -} -.table-row-cell:odd, .table-row-cell:odd:filled:selected, .table-row-cell:odd:selected{ - -fx-background-color: -fx-table-cell-border-color, #fefefe; - -fx-background-insets: 0, 0 0 1 0; - -fx-padding: 0.0em; /* 0 */ - -fx-table-cell-border-color: #b0b0b0; -} /* -========================== Context menu =====================- */ .context-menu { -fx-background-color: #fefefe; @@ -250,12 +268,12 @@ /* -========================== footer pane =====================- */ .footer{ -fx-background-color: #ffffff; + -fx-border-color: #b5b5b5; + -fx-border-width: 1 0 0 0; } - -.regionRemove{ - -fx-shape: "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"; - -fx-background-color: #830002; - -fx-min-height: 15; - -fx-min-width: 15; +.header { + -fx-background-image: url("pttrn.png"); + -fx-background-position: center; + -fx-background-repeat: repeat; } \ No newline at end of file