Skip to content

Commit

Permalink
Fix fark theme and from to logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LevelUp8 committed May 8, 2022
1 parent 64fb234 commit a748760
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public void configure() {
KeyCombination kc = new KeyCodeCombination(KeyCode.A, KeyCombination.CONTROL_DOWN);
inputOutputButtons.openFile().setAccelerator(kc);
}
{
KeyCombination kc = new KeyCodeCombination(KeyCode.O, KeyCombination.CONTROL_DOWN);
inputOutputButtons.openFile().setAccelerator(kc);
}
{
KeyCombination kc = new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN);
inputOutputButtons.saveFile().setAccelerator(kc);
Expand All @@ -62,7 +66,7 @@ public void configure() {


{
KeyCombination kc = new KeyCodeCombination(KeyCode.U, KeyCombination.CONTROL_DOWN);
KeyCombination kc = new KeyCodeCombination(KeyCode.Z, KeyCombination.CONTROL_DOWN);
undo.setAccelerator(kc);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ public boolean execute() {

int counter = 0;
for (Row row : observableList) {
int until = row.getContent().indexOf(this.until);
int startFrom = row.getContent().indexOf(from);
int until = row.content().indexOf(this.until);
int startFrom = row.content().indexOf(from);
if (startFrom != -1) {
counter++;
if (counter == 1) {
String contentFrom = row.getContent().substring(startFrom);
String contentFrom = row.content().substring(startFrom);
int startUntilOnSameRow = contentFrom.indexOf(this.until);

if (startUntilOnSameRow != -1) {
contentFrom = contentFrom.substring(0, startUntilOnSameRow + this.until.length());
counter--;
rows.add(new Row(row.getRowNumber(), contentFrom));
rows.add(new Row(row.rowNumber(), contentFrom));
}
else
{
tempRows.add(new Row(row.getRowNumber(), contentFrom));
tempRows.add(new Row(row.rowNumber(), contentFrom));
}
} else {
if (counter > 0) {
Expand All @@ -69,8 +69,8 @@ public boolean execute() {
}

if (counter == 0) {
String endContentUntil = row.getContent().substring(0, until + this.until.length());
Row untilRow = new Row(row.getRowNumber(), endContentUntil);
String endContentUntil = row.content().substring(0, until + this.until.length());
Row untilRow = new Row(row.rowNumber(), endContentUntil);
tempRows.add(untilRow);
rows.addAll(tempRows);
tempRows = new ArrayList<>();
Expand Down
18 changes: 18 additions & 0 deletions src/main/resources/com/kagu/edit/jkagu/dark-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
-fx-font-weight: none;
}


.list-cell:even,
.list-cell:odd,
.table-row-cell:even,
Expand All @@ -67,4 +68,21 @@
.table-row-cell{
-fx-border-color: transparent;
-fx-table-cell-border-color:transparent;
}


.list-view .list-cell:even {
-fx-background-color: #444C53;
-fx-control-inner-background-alt: derive(-fx-control-inner-background, 50%);
-fx-text-fill: white;
}
.list-view .list-cell:odd {
-fx-background-color: #373e43;
-fx-control-inner-background-alt: derive(-fx-control-inner-background, 50%);
-fx-text-fill: white;
}

.list-view .list-cell:selected:odd,
.list-view .list-cell:selected:even {
-fx-background-color: #0059b3;
}
6 changes: 3 additions & 3 deletions src/main/resources/com/kagu/edit/jkagu/hello-view.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<HBox fx:id="searchBox" prefHeight="38.0" prefWidth="658.0">
<children>

<RadioButton fx:id="useSelectedLines" prefHeight="27.0" prefWidth="132.0" style="-fx-padding: 5px;" text="Select Lines">
<RadioButton fx:id="useSelectedLines" prefHeight="27.0" prefWidth="132.0" style="-fx-padding: 5px;" text="Select Line">
<HBox.margin>
<Insets left="5.0" />
</HBox.margin>
Expand Down Expand Up @@ -111,7 +111,7 @@
</TextField>
</children>
</HBox>
<Button fx:id="searchButton" prefHeight="24.0" prefWidth="74.0" text="Search">
<Button fx:id="searchButton" prefHeight="24.0" prefWidth="74.0" text="Select">
<HBox.margin>
<Insets left="20.0" right="10.0" />
</HBox.margin>
Expand Down Expand Up @@ -198,7 +198,7 @@
<Insets left="10.0" right="10.0" top="5.0" />
</HBox.margin>
</ProgressBar>
<CheckBox fx:id="caseSensitiveSearch" mnemonicParsing="false" prefHeight="18.0" prefWidth="220.0" text="Case Sensitive Search">
<CheckBox fx:id="caseSensitiveSearch" mnemonicParsing="false" prefHeight="18.0" prefWidth="220.0" text="Case Sensitive Select">
<HBox.margin>
<Insets right="10.0" top="5.0" />
</HBox.margin>
Expand Down

0 comments on commit a748760

Please sign in to comment.