Skip to content

Commit 649e0af

Browse files
committed
美化主标签页中的菜单栏
1 parent abc95f0 commit 649e0af

2 files changed

Lines changed: 84 additions & 87 deletions

File tree

Lines changed: 72 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,77 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<?import javafx.geometry.Insets?>
4-
<?import javafx.scene.control.CheckMenuItem?>
5-
<?import javafx.scene.control.Hyperlink?>
6-
<?import javafx.scene.control.Label?>
7-
<?import javafx.scene.control.Menu?>
8-
<?import javafx.scene.control.MenuBar?>
9-
<?import javafx.scene.control.MenuItem?>
10-
<?import javafx.scene.control.ScrollPane?>
11-
<?import javafx.scene.control.SeparatorMenuItem?>
12-
<?import javafx.scene.control.Tab?>
13-
<?import javafx.scene.control.TabPane?>
14-
<?import javafx.scene.control.TextField?>
15-
<?import javafx.scene.layout.AnchorPane?>
16-
<?import javafx.scene.layout.HBox?>
17-
<?import javafx.scene.layout.VBox?>
4+
<?import javafx.scene.control.*?>
5+
<?import javafx.scene.layout.*?>
186
<?import javafx.scene.web.WebView?>
19-
20-
<?import javafx.scene.layout.Pane?>
21-
<AnchorPane prefHeight="654.0" prefWidth="1044.0" stylesheets="/com/xwintop/xJavaFxTool/fxmlView/newui/main.css" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.xwintop.xJavaFxTool.controller.IndexController">
22-
<children>
23-
<TabPane fx:id="tabPaneMain" tabClosingPolicy="ALL_TABS" tabMinWidth="45.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
24-
<tabs>
25-
<Tab closable="false" text="%start">
26-
<content>
27-
<ScrollPane fitToWidth="true" style="-fx-border-width: 0 1 1 1;-fx-border-color: #CCCCCC;-fx-background:#2a2a2a">
28-
<content>
29-
<VBox>
30-
<children>
31-
<HBox alignment="CENTER_LEFT" spacing="5.0">
32-
<children>
33-
<MenuBar fx:id="mainMenuBar" cache="true">
34-
<menus>
35-
<Menu fx:id="fileMenu" mnemonicParsing="false" text="%File">
36-
<items>
37-
<MenuItem mnemonicParsing="false" onAction="#closeAllTabAction" text="%closeAllTab" />
38-
<MenuItem mnemonicParsing="false" onAction="#openAllTabAction" text="%openAllTab" />
39-
<MenuItem mnemonicParsing="false" onAction="#pluginManageAction" text="%plugin_manage" />
40-
<MenuItem mnemonicParsing="false" onAction="#addNodepadAction" text="%addNodepad" />
41-
<CheckMenuItem fx:id="singleWindowBootCheckMenuItem" mnemonicParsing="false" text="%singleWindowBootCheckBox" />
42-
<MenuItem mnemonicParsing="false" onAction="#addLogConsoleAction" text="%addLogConsole" />
43-
<SeparatorMenuItem />
44-
<MenuItem mnemonicParsing="false" onAction="#exitAction" text="%Exit" />
45-
</items>
46-
</Menu>
47-
<Menu fx:id="moreToolsMenu" mnemonicParsing="false" text="%More_Tools" />
48-
<Menu fx:id="helpMenu" mnemonicParsing="false" text="%Help">
49-
<MenuItem mnemonicParsing="false" onAction="#openLogFileAction" text="%openLogFile" />
50-
<MenuItem mnemonicParsing="false" onAction="#openLogFolderAction" text="%openLogFolder" />
51-
<MenuItem mnemonicParsing="false" onAction="#openConfigFolderAction" text="%openConfigFolder" />
52-
<MenuItem mnemonicParsing="false" onAction="#openPluginFolderAction" text="%openPluginFolder" />
53-
<SeparatorMenuItem />
54-
<items>
55-
<Menu mnemonicParsing="false" text="%SetLanguage">
56-
<items>
57-
<MenuItem mnemonicParsing="false" onAction="#setLanguageAction" text="简体中文" />
58-
<MenuItem mnemonicParsing="false" onAction="#setLanguageAction" text="English" />
59-
</items>
60-
</Menu>
61-
<SeparatorMenuItem />
62-
<MenuItem mnemonicParsing="false" onAction="#userSupportAction" text="%userSupport" />
63-
<MenuItem mnemonicParsing="false" onAction="#SettingAction" text="%Setting" />
64-
<MenuItem mnemonicParsing="false" onAction="#aboutAction" text="%About" />
65-
</items>
66-
</Menu>
67-
</menus>
68-
</MenuBar>
69-
<Label text="%search">
70-
<padding>
71-
<Insets left="10.0" />
72-
</padding></Label>
73-
<TextField fx:id="myTextField" promptText="%selectTextField" styleClass="search-text" />
74-
<WebView fx:id="tongjiWebView" prefHeight="1.0" prefWidth="1.0" visible="false" />
75-
<Pane HBox.hgrow="ALWAYS"/>
76-
<Hyperlink onAction="#xwintopLinkOnAction" text="http://gitee.com/xwintop/xJavaFxTool" textFill="#868686" />
77-
</children>
78-
<VBox.margin>
79-
<Insets top="5.0" />
80-
</VBox.margin>
81-
</HBox>
82-
<VBox fx:id="pluginCategories" alignment="TOP_CENTER" />
83-
</children>
84-
</VBox>
85-
</content>
86-
</ScrollPane>
87-
</content>
88-
</Tab>
89-
</tabs>
90-
</TabPane>
91-
</children>
7+
<AnchorPane prefHeight="654.0" prefWidth="1044.0" stylesheets="/com/xwintop/xJavaFxTool/fxmlView/newui/main.css"
8+
xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"
9+
fx:controller="com.xwintop.xJavaFxTool.controller.IndexController">
10+
<TabPane fx:id="tabPaneMain" tabClosingPolicy="ALL_TABS" tabMinWidth="45.0" AnchorPane.bottomAnchor="0.0"
11+
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
12+
<Tab closable="false" text="%start">
13+
<ScrollPane fitToWidth="true"
14+
style="-fx-border-width: 0 1 1 1;-fx-border-color: #CCCCCC;-fx-background:#2a2a2a">
15+
<VBox>
16+
<HBox alignment="CENTER_LEFT" spacing="5.0">
17+
<VBox.margin>
18+
<Insets top="5.0"/>
19+
</VBox.margin>
20+
<MenuBar fx:id="mainMenuBar" cache="true" styleClass="main-menu-bar">
21+
<Menu fx:id="fileMenu" mnemonicParsing="false" text="%File">
22+
<MenuItem mnemonicParsing="false" onAction="#closeAllTabAction"
23+
text="%closeAllTab"/>
24+
<MenuItem mnemonicParsing="false" onAction="#openAllTabAction"
25+
text="%openAllTab"/>
26+
<MenuItem mnemonicParsing="false" onAction="#pluginManageAction"
27+
text="%plugin_manage"/>
28+
<MenuItem mnemonicParsing="false" onAction="#addNodepadAction"
29+
text="%addNodepad"/>
30+
<CheckMenuItem fx:id="singleWindowBootCheckMenuItem" mnemonicParsing="false"
31+
text="%singleWindowBootCheckBox"/>
32+
<MenuItem mnemonicParsing="false" onAction="#addLogConsoleAction"
33+
text="%addLogConsole"/>
34+
<SeparatorMenuItem/>
35+
<MenuItem mnemonicParsing="false" onAction="#exitAction" text="%Exit"/>
36+
</Menu>
37+
<Menu fx:id="moreToolsMenu" mnemonicParsing="false" text="%More_Tools"/>
38+
<Menu fx:id="helpMenu" mnemonicParsing="false" text="%Help">
39+
<MenuItem mnemonicParsing="false" onAction="#openLogFileAction"
40+
text="%openLogFile"/>
41+
<MenuItem mnemonicParsing="false" onAction="#openLogFolderAction"
42+
text="%openLogFolder"/>
43+
<MenuItem mnemonicParsing="false" onAction="#openConfigFolderAction"
44+
text="%openConfigFolder"/>
45+
<MenuItem mnemonicParsing="false" onAction="#openPluginFolderAction"
46+
text="%openPluginFolder"/>
47+
<SeparatorMenuItem/>
48+
<Menu mnemonicParsing="false" text="%SetLanguage">
49+
<MenuItem mnemonicParsing="false" onAction="#setLanguageAction"
50+
text="简体中文"/>
51+
<MenuItem mnemonicParsing="false" onAction="#setLanguageAction"
52+
text="English"/>
53+
</Menu>
54+
<SeparatorMenuItem/>
55+
<MenuItem mnemonicParsing="false" onAction="#userSupportAction"
56+
text="%userSupport"/>
57+
<MenuItem mnemonicParsing="false" onAction="#SettingAction" text="%Setting"/>
58+
<MenuItem mnemonicParsing="false" onAction="#aboutAction" text="%About"/>
59+
</Menu>
60+
</MenuBar>
61+
<Label text="%search" style="-fx-text-fill: #AAAAAA">
62+
<padding>
63+
<Insets left="10.0"/>
64+
</padding>
65+
</Label>
66+
<TextField fx:id="myTextField" promptText="%selectTextField" styleClass="search-text"/>
67+
<WebView fx:id="tongjiWebView" prefHeight="1.0" prefWidth="1.0" visible="false"/>
68+
<Pane HBox.hgrow="ALWAYS"/>
69+
<Hyperlink onAction="#xwintopLinkOnAction" text="http://gitee.com/xwintop/xJavaFxTool"
70+
textFill="#868686"/>
71+
</HBox>
72+
<VBox fx:id="pluginCategories" alignment="TOP_CENTER"/>
73+
</VBox>
74+
</ScrollPane>
75+
</Tab>
76+
</TabPane>
9277
</AnchorPane>

src/main/resources/com/xwintop/xJavaFxTool/fxmlView/newui/main.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@
5252
-fx-focus-color: transparent;
5353
-fx-faint-focus-color: transparent;
5454
}
55+
56+
.main-menu-bar {
57+
-fx-background-color: transparent;
58+
}
59+
60+
.main-menu-bar .menu .label {
61+
-fx-text-fill: white;
62+
}
63+
64+
.main-menu-bar .menu-item .label {
65+
-fx-text-fill: inherit;
66+
}

0 commit comments

Comments
 (0)