-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Native window behavior and design brush-up
Fixes #1007 Fixes #1033 Fixes #1038 Fixes #1075 Fixes #1685 Fixes #1751 Fixes #1760 Fixes #1766 Fixes #1815 Fixes #1816 Fixes #1817 Fixes #1821
- Loading branch information
1 parent
9cfd412
commit f5ff9bf
Showing
141 changed files
with
4,209 additions
and
3,402 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.
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
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
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,50 @@ | ||
package com.faforever.client.fx; | ||
|
||
import com.faforever.client.theme.UiService; | ||
import com.google.common.base.Strings; | ||
import javafx.geometry.Pos; | ||
import javafx.scene.control.TableCell; | ||
import javafx.scene.layout.Region; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.function.Function; | ||
|
||
public class IconCell<S, T> extends TableCell<S, T> { | ||
|
||
private final Function<T, String> iconCssClassFunction; | ||
private final Pos alignment; | ||
private final String[] containerCssClasses; | ||
|
||
public IconCell(Function<T, String> iconCssClassFunction) { | ||
this(iconCssClassFunction, Pos.CENTER_LEFT); | ||
} | ||
|
||
public IconCell(Function<T, String> iconCssClassFunction, Pos alignment, String... containerCssClasses) { | ||
this.iconCssClassFunction = iconCssClassFunction; | ||
this.alignment = alignment; | ||
this.containerCssClasses = containerCssClasses; | ||
} | ||
|
||
@Override | ||
protected void updateItem(T item, boolean empty) { | ||
super.updateItem(item, empty); | ||
|
||
setText(null); | ||
if (empty || item == null) { | ||
setGraphic(null); | ||
} else { | ||
String cssClass = iconCssClassFunction.apply(item); | ||
if (Strings.isNullOrEmpty(cssClass)) { | ||
setGraphic(null); | ||
return; | ||
} | ||
|
||
Region region = new Region(); | ||
region.getStyleClass().add(UiService.CSS_CLASS_ICON); | ||
region.getStyleClass().add(cssClass); | ||
setGraphic(region); | ||
setAlignment(alignment); | ||
getStyleClass().addAll(containerCssClasses); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.