Skip to content

Commit

Permalink
Completed UI tab and Window Mode tab in settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
EasyG0ing1 committed Apr 13, 2022
1 parent 16ca331 commit dc45afa
Show file tree
Hide file tree
Showing 39 changed files with 221 additions and 133 deletions.
File renamed without changes
File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@
<artifactId>FXTrayIcon</artifactId>
<version>3.1.2</version>
</dependency>-->
<dependency>
<groupId>com.simtechdata</groupId>
<artifactId>FXTrayIcon</artifactId>
<version>3.1.2</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -205,6 +210,7 @@
<customizedJre>false</customizedJre>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<copyDependencies>true</copyDependencies>
</configuration>
<executions>
<execution>
Expand All @@ -214,6 +220,7 @@
<goal>package</goal>
</goals>
<configuration>
<assetsDir>/Users/michael/IdeaProjects/GistFX/assets</assetsDir>
<platform>auto</platform>
<createZipball>false</createZipball>
<createTarball>true</createTarball>
Expand All @@ -228,11 +235,11 @@
<generateMsi>false</generateMsi>
</winConfig>
<macConfig>
<icnsFile>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</icnsFile>
<!-- <icnsFile>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</icnsFile>-->
<generateDmg>true</generateDmg>
<generatePkg>false</generatePkg>
<volumeName>GistFX</volumeName>
<volumeIcon>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</volumeIcon>
<!-- <volumeIcon>/Users/michael/IdeaProjects/GistFX/src/main/resources/com/redmondsims/gistfx/Assets/mac/GistFX.icns</volumeIcon>-->
<entitlements>entitlements.plist</entitlements>
</macConfig>
</configuration>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/redmondsims/gistfx/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Main extends Application {
LiveSettings.init();
Resources.init();
TreeIcons.init();
TrayIcon.start(primaryStage,AppSettings.get().runInSystemTray());
TrayIcon.start(primaryStage, AppSettings.get().runInSystemTray());
AppSettings.clear().fileMoveWarning();
LiveSettings.applyAppSettings();
String color = LiveSettings.getLoginScreenColor().Name();
Expand Down Expand Up @@ -108,6 +108,12 @@ public static void main(String[] args) {
if (arg.toLowerCase().startsWith("wipesql")) {
Action.wipeSQLOnly();
}
if (arg.toLowerCase().startsWith("iconbase=")) {
String num = arg.replaceFirst("iconbase=", "");
double value = Double.parseDouble(num);
AppSettings.set().iconBaseSize(value);
System.out.println("iconbase set to " + value);
}
}
if (stopFlag) System.exit(100);
launch(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ public static String[] newGistAlert(String fileText, boolean categorySet, String
tfFilename.textProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.isEmpty()) tfFilename.setText("File.java");
String ext = FilenameUtils.getExtension(newValue);
if(ext.toLowerCase().contains("py")) ext = "python";
monacoFX.getEditor().setCurrentLanguage(ext);
});
tfFilename.setMinWidth(250);
Expand Down
20 changes: 7 additions & 13 deletions src/main/java/com/redmondsims/gistfx/gist/GistFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ private ImageView getIcon() {
Private getters
*/

private String getFileExtension() {
boolean hasDot = fileName.name().contains(".");
if (hasDot) {
return FilenameUtils.getExtension(fileName.name());
}
return "";
private void setEditorLanguage(String fileExtension) {
String language = fileExtension;
if (language.equals("py")) language = "python";
CodeEditor.setLanguage(language);
}

/**
Expand Down Expand Up @@ -221,15 +219,15 @@ public void undo() {

public void setName(String newFilename) {
String oldFilename = fileName.getValue();
CodeEditor.setLanguage(getFileExtension());
setEditorLanguage(FilenameUtils.getExtension(this.fileName.getValue()));
Action.renameFile(gistId, fileId, oldFilename, newFilename, liveVersion.getValue());
Platform.runLater(() -> fileName.setValue(newFilename));
}

public void setActive() {
GistManager.unBindFileObjects();
CodeEditor.bindDocumentTo(this);
CodeEditor.setLanguage(getFileExtension());
setEditorLanguage(FilenameUtils.getExtension(this.fileName.getValue()));
CodeEditor.get().setDisable(fileState.equals(CONFLICT));
}

Expand Down Expand Up @@ -274,15 +272,11 @@ public String getGistId() {
public Integer getFileId() {return fileId;}

public String getLanguage() {
return getFileExtension();
return FilenameUtils.getExtension(fileName.getValue());
}

public ObjectProperty<Node> getGraphicNode() {return graphicNode;}

public CStringProperty getNameProperty() {
return fileName;
}

/**
SQL Actions
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public void lastGitHubUserId() {

public void dividerExpanded() {prefs.remove(LABEL.DIVIDER_EXPANDED.name());}

public void iconBaseSize() {prefs.remove(LABEL.ICON_BASE_SIZE.name());}


/**
* Tree Icon SMTPServerSettings
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/com/redmondsims/gistfx/preferences/settings/Get.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public class Get {

public Color progressBarColor() {
Color color;
if(progressColorRandom()) {
color = Colors.random();
}
else if (progressColorLogin()) {
if (progressColorLogin()) {
color = LiveSettings.getLoginScreenColor().getColor();
}
else if(progressColorRandom()) {
color = Colors.random();
}
else {
color = progressCustomColor();
}
Expand Down Expand Up @@ -84,17 +84,17 @@ public Color dirtyFileFlagColor() {
}

public Color categoryFolderIconColor() {
String setting = LABEL.prefs.get(LABEL.CATEGORY_FOLDER_ICON_COLOR.Name(), "0xffa200ff");
String setting = LABEL.prefs.get(LABEL.CATEGORY_FOLDER_ICON_COLOR.Name(), "0xcc6633ff");
return Color.valueOf(setting);
}

public Color gistFolderIconColor() {
String setting = prefs.get(LABEL.GIST_FOLDER_ICON_COLOR.name(), "0xffff00ff");
String setting = prefs.get(LABEL.GIST_FOLDER_ICON_COLOR.name(), "0xe6994dff");
return Color.valueOf(setting);
}

public Color fileIconColor() {
String setting = prefs.get(LABEL.FILE_ICON_COLOR.Name(), "0xccffffff");
String setting = prefs.get(LABEL.FILE_ICON_COLOR.Name(), "0xffe6b3ff");
return Color.valueOf(setting);
}

Expand Down Expand Up @@ -166,5 +166,9 @@ public double dividerExpanded() {
return prefs.getDouble(LABEL.DIVIDER_EXPANDED.Name(), 0.0);
}

public double iconBaseSize() {
return prefs.getDouble(LABEL.ICON_BASE_SIZE.Name(), 0.0);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public enum LABEL {
SYSTRAY_COLOR,
SHOW_APP_ICON,
DIVIDER_AT_REST,
DIVIDER_EXPANDED
;
DIVIDER_EXPANDED,
ICON_BASE_SIZE;

public String Name(LABEL this) {
if (LiveSettings.getDevMode()) {
Expand Down Expand Up @@ -77,6 +77,7 @@ public String Name(LABEL this) {
case SHOW_APP_ICON -> "GFX_DEV_Show_App_Icon";
case DIVIDER_AT_REST -> "GFX_DEV_Divider_At_Rest";
case DIVIDER_EXPANDED -> "GFX_DEV_Divider_Expanded";
case ICON_BASE_SIZE -> "GFX_DEV_Icon_Base_Size";
};
}
else {
Expand Down Expand Up @@ -114,6 +115,7 @@ public String Name(LABEL this) {
case SHOW_APP_ICON -> "GFX_Show_App_Icon";
case DIVIDER_AT_REST -> "GFX_Divider_At_Rest";
case DIVIDER_EXPANDED -> "GFX_Divider_Expanded";
case ICON_BASE_SIZE -> "GFX_Icon_Base_Size";
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ public void dividerExpanded(double value) {
prefs.putDouble(LABEL.DIVIDER_EXPANDED.Name(), value);
}

public void iconBaseSize(double value) {
AppSettings.clear().iconBaseSize();
prefs.putDouble(LABEL.ICON_BASE_SIZE.Name(), value);
}

public void setDefaults() {
try {prefs.clear();}catch (BackingStoreException e) {e.printStackTrace();}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Tab contents (Type type) {
GridPane.setRowIndex(colorPicker, 1);
GridPane.setValignment(colorPicker, javafx.geometry.VPos.CENTER);
colorPicker.setPrefHeight(26.0);
colorPicker.setPrefWidth(110.0);
colorPicker.setPrefWidth(150.0);

GridPane.setColumnIndex(btnResetDefault, 1);
GridPane.setHalignment(btnResetDefault, javafx.geometry.HPos.CENTER);
Expand Down Expand Up @@ -172,7 +172,6 @@ public Tab contents (Type type) {
lblColor.visibleProperty().bind(cbUseCustomIcon.selectedProperty().not());
btnDefaultColor.visibleProperty().bind(cbUseCustomIcon.selectedProperty().not());
colorPicker.visibleProperty().bind(cbUseCustomIcon.selectedProperty().not());
colorPicker.setPrefWidth(100);

//Control Actions
cbUseCustomIcon.setOnAction(e -> {
Expand Down Expand Up @@ -321,7 +320,6 @@ private void resetUserIconSettings(Type type) {
}
}


private String getTypeString(Type type) {
return switch(type) {
case CATEGORY -> "Category Folder";
Expand Down
Loading

0 comments on commit dc45afa

Please sign in to comment.