asdfjkl / jfxchess

JFXChess - Chess Program
https://asdfjkl.github.io/jfxchess
GNU General Public License v2.0
102 stars 21 forks source link

Change the background color #111

Closed ExtremeCoolDude closed 3 years ago

ExtremeCoolDude commented 3 years ago

Hello, I'm not a coder but wanted to adjust UI to my taste. I have a few questions, if you want me to open separate issues please let me know.

no. 1

Is the background filled with lighter square colors ? is there a way to hardcode it without breaking things ? Thank you in advance.

image

  if(colorStyle == STYLE_GREEN) {
            borderColor = BORDER_GREEN;
            coordinateColor = COORDINATE_COLOR_GREEN;
            darkSquareColor = DARK_SQUARE_GREEN;
            lightSquareColor = LIGHT_SQUARE_GREEN;
        }

I can't figure out which one is for background on BoardStyle.java

public void updateCanvas() {

            GraphicsContext gc = this.getGraphicsContext2D();

            // fill background
            gc.beginPath();
            gc.setFill(Color.rgb(90, 59, 46));
            //gc.setFill(boardStyle.getLightSquareColor());
            gc.rect(0, 0, this.getWidth(), this.getHeight());
            gc.fill();

on ShowAppearanceBoard.java I uncommented your commented part, so I expected background to fill with supplied rgb, but it was of the settings window : image

no. 2

On an completely unrelated note, when I run start.sh program starts without a problem, when I do java -jar {jerry.jar} it runs without a problem BUT when I create a desktop entry with no dashes etc (as per standard, proper permissions) no matter what I do I get "Unable to access {jerry}.jar " error message, would you have any idea as what would be causing it ? (Not sure if this issue is of software or Linux)

no. 3

I want to build the app with dark theme. According to https://www.pixelduke.com/java-javafx-theme-jmetro/#Backgrounds

I tried to do on App.java on line 714 :

 Style style = new Style();
        JMetro jMetro = new JMetro(style.DARK);
        jMetro.setScene(scene);
        jMetro.setautomaticallyColorPanes(true);

I keeping getting symbol not found error, please forgive me if this is a silly question, I don't know much coding.

asdfjkl commented 3 years ago

1.) Chessboard.java is the "main" board. Update updateCanvas() there. ShowAppearanceBoard and EnterPosBoard are for the graphics dialog and the dialog for entering a new position. You might update updateCanvas() there as well. 2.) check capitalization, it's JMetro jMetro = new JMetro(Style.DARK); not JMetro jMetro = new JMetro(style.DARK);

ExtremeCoolDude commented 3 years ago

Thanks a lot ! Looks beautiful! image

asdfjkl commented 3 years ago

looks nice indeed. Maybe I should add a dark mode in a future version...

ExtremeCoolDude commented 3 years ago

That'd be awesome! You could also publish Jerry(Dark version) executables only + light versions only since its just a few lines modification.

Here's a somewhat messy patch incase someone wants a mod in the meantime. https://gist.github.com/ExtremeCoolDude/d2c4f1f6fa12c47ee830dc82fd9fe213