-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Settings menu to Drifty GUI (#544)
* added the Settings.java file - done with Auto-Paste box * added the Settings.java file - done with Auto-Paste box * ended the page , added heading , added dark theme CSS , added dark theme choiceBox * added the btnSave/Start png , added the banner Dark png , added the splash dark png and make the dark theme apply on them * testing the splash * ended the select directory feat. , edited the labels styles * Fromating code * Fromating code * Fromating code 2 * solved most of the AI bots errors * Solved an About-stage bug * Added the applyTheme() method in Settings.java * modified the handelDirectory method , added messageBroker getter * Done the bidirectionally bind between tow checbox (Settign , Main) * modifing the autoPaste main , Settings Logic * Fixed an Save/Start icons bug , improved the icons methods readablty * removed the unsafe getClass().getResources() * Refactoring the Settings code * fix: Fixed duplicate code, linter issues, redundant method calls and removed spelling mistakes * fix: Fixed a method spacing issue * fix: Fixed a minor linter issue * Add: Added the Theme.java Class , migrating the theme logic into it * Removing unused imports and the Arralist declaration * fix: Fixed linter issues and applied all CodeRabbitAI reviews * fix: Fixed a minor linter issue * Refactoring the code * Solving some of linter errors * fix: Implemented all of the reviews except one * fix: Fixed linter issue * fix: implemented all the reviews * added the dark theme to info window * fix: solved the lint error * fix: sovlving the ai reveiws * fix: linter error fixed * fix: Fixed failure to initialise About scene in Drifty GUI native image --------- Co-authored-by: Ziad Ashraf <[email protected]> Co-authored-by: Saptarshi Sarkar <[email protected]>
- Loading branch information
1 parent
a5c4b58
commit ebbbb0c
Showing
32 changed files
with
810 additions
and
216 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package gui.preferences; | ||
|
||
public enum Labels implements preferences.Labels { | ||
FOLDERS, MAIN_AUTO_PASTE, JOBS, ALWAYS_AUTO_PASTE | ||
FOLDERS, MAIN_AUTO_PASTE, JOBS, ALWAYS_AUTO_PASTE, MAIN_THEME | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package gui.utils; | ||
|
||
import javafx.geometry.Pos; | ||
import javafx.scene.Node; | ||
import javafx.scene.control.Hyperlink; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.control.TextField; | ||
import javafx.scene.image.Image; | ||
import javafx.scene.image.ImageView; | ||
import javafx.scene.layout.HBox; | ||
import javafx.scene.paint.LinearGradient; | ||
import javafx.scene.paint.Paint; | ||
import javafx.scene.text.Font; | ||
import main.Drifty_GUI; | ||
|
||
import java.util.Objects; | ||
|
||
import static gui.support.Constants.MONACO_TTF; | ||
|
||
public class UIComponentBuilder { | ||
private static UIComponentBuilder instance; | ||
|
||
public static UIComponentBuilder getInstance() { | ||
if (instance == null) { | ||
instance = new UIComponentBuilder(); | ||
} | ||
return instance; | ||
} | ||
|
||
public Label buildLabel() { | ||
Label label = new Label(""); | ||
label.setFont(new Font(Objects.requireNonNull(MONACO_TTF).toExternalForm(), 20 * .75)); | ||
label.prefWidth(Double.MAX_VALUE); | ||
label.setAlignment(Pos.CENTER); | ||
return label; | ||
} | ||
|
||
public Label buildLabel(String text, Font font, Paint textFill) { | ||
Label label = new Label(text); | ||
label.setAlignment(Pos.TOP_CENTER); | ||
label.setFont(font); | ||
label.setTextFill(textFill); | ||
return label; | ||
} | ||
|
||
public HBox buildHBox(Node node) { | ||
HBox hbox = new HBox(node); | ||
hbox.setAlignment(Pos.CENTER); | ||
return hbox; | ||
} | ||
|
||
public ImageView buildImageView(Image image, double scale) { | ||
ImageView imageView = new ImageView(image); | ||
imageView.setPreserveRatio(true); | ||
imageView.setFitWidth(image.getWidth() * scale); | ||
return imageView; | ||
} | ||
|
||
public TextField buildTextField() { | ||
TextField tf = new TextField(""); | ||
tf.setPrefWidth(Double.MAX_VALUE); | ||
return tf; | ||
} | ||
|
||
public Hyperlink buildHyperlink(String text, Font font, LinearGradient fill, String url) { | ||
Hyperlink link = new Hyperlink(text); | ||
link.setFont(font); | ||
link.setTextFill(fill); | ||
link.setOnAction(e -> Drifty_GUI.INSTANCE.openWebsite(url)); | ||
return link; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.