Skip to content

Commit 8fc3eb9

Browse files
committed
fixed mac font issue
1 parent 996b6d1 commit 8fc3eb9

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

ShiftOverflow_v0.3.0.jar

2.64 MB
Binary file not shown.

src/ui/ScheduleStage.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import javafx.scene.control.ScrollPane;
1313
import javafx.scene.layout.GridPane;
1414
import javafx.scene.paint.Color;
15+
import javafx.scene.text.Font;
16+
import javafx.scene.text.FontPosture;
17+
import javafx.scene.text.FontWeight;
18+
import javafx.scene.text.Text;
19+
import javafx.scene.text.TextFlow;
1520

1621
public class ScheduleStage extends KarenStage {
1722

@@ -81,18 +86,21 @@ public GridPane writeSchedule(Schedule schedule) {
8186
for (int i = 0; i < max; i++) {
8287
for (int day = 0; day < 7; day++) {
8388
if (i < shifts.get(day).get(hour).size()) {
84-
Label scheduledEmployee = new Label(shifts.get(day).get(hour).get(i).toString());
89+
Text scheduledEmployee = new Text(shifts.get(day).get(hour).get(i).toString());
90+
scheduledEmployee.setFont(Font.font("SansSerif", FontWeight.NORMAL, 12));
91+
8592
//bold shift lead
8693
if (_ui.getCurrentEmployee() != null && schedule.getWeek().getShift(day, hour).getLead() != null && shifts.get(day).get(hour).get(i).equals(schedule.getWeek().getShift(day, hour).getLead())) {
87-
scheduledEmployee.setStyle("-fx-font-weight: bold");
94+
scheduledEmployee.setFont(Font.font("SansSerif", FontWeight.BOLD, 12));
95+
//scheduledEmployee.setFont(Font.getDefault());
8896
}
8997
// highlight your name on the schedule
9098
if ((_ui.getCurrentEmployee() != null)
9199
&& (shifts.get(day).get(hour).get(i).toString().equals(_ui.getCurrentEmployee().getName()))) {
92-
scheduledEmployee.setTextFill(Color.RED);
100+
scheduledEmployee.setFill(Color.RED);
93101
}
94102
// +1 to account for day row
95-
schedulePane.add(scheduledEmployee, day + 1, hourRow + i + 1);
103+
schedulePane.add(new TextFlow(scheduledEmployee), day + 1, hourRow + i + 1);
96104
}
97105
}
98106
}

src/ui/UI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void displayAvailable(Employee employee) {
119119
if (_availabilityStage != null){
120120
_availabilityStage.close();
121121
}
122-
_availabilityStage = new AvailabilityStage("ShiftOverflow v0.2.3", _controller, this);
122+
_availabilityStage = new AvailabilityStage("ShiftOverflow v0.3.0", _controller, this);
123123
_availabilityStage.show();
124124
}
125125

0 commit comments

Comments
 (0)