Confined Mac users to Downloads/ directory
This commit is contained in:
@@ -99,6 +99,11 @@ public class FileChooser extends FloatingDialog {
|
|||||||
updateFiles(true);
|
updateFiles(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Macs are confined to the Downloads/ directory
|
||||||
|
if(OS.isMac){
|
||||||
|
up.setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
ImageButton back = new ImageButton("icon-arrow-left");
|
ImageButton back = new ImageButton("icon-arrow-left");
|
||||||
back.resizeImage(isize);
|
back.resizeImage(isize);
|
||||||
|
|
||||||
@@ -169,7 +174,8 @@ public class FileChooser extends FloatingDialog {
|
|||||||
|
|
||||||
private void updateFiles(boolean push){
|
private void updateFiles(boolean push){
|
||||||
if(push) stack.push(directory);
|
if(push) stack.push(directory);
|
||||||
navigation.setText(directory.toString());
|
//if is mac, don't display extra info since you can only ever go to downloads
|
||||||
|
navigation.setText(OS.isMac ? directory.name() : directory.toString());
|
||||||
|
|
||||||
GlyphLayout layout = Pools.obtain(GlyphLayout.class);
|
GlyphLayout layout = Pools.obtain(GlyphLayout.class);
|
||||||
|
|
||||||
@@ -184,23 +190,25 @@ public class FileChooser extends FloatingDialog {
|
|||||||
Pools.free(layout);
|
Pools.free(layout);
|
||||||
|
|
||||||
files.clearChildren();
|
files.clearChildren();
|
||||||
|
files.top().left();
|
||||||
FileHandle[] names = getFileNames();
|
FileHandle[] names = getFileNames();
|
||||||
|
|
||||||
Image upimage = new Image("icon-folder-parent");
|
//macs are confined to the Downloads/ directory
|
||||||
|
if(!OS.isMac) {
|
||||||
|
Image upimage = new Image("icon-folder-parent");
|
||||||
|
TextButton upbutton = new TextButton(".." + directory.toString());
|
||||||
|
upbutton.clicked(() -> {
|
||||||
|
directory = directory.parent();
|
||||||
|
updateFiles(true);
|
||||||
|
});
|
||||||
|
|
||||||
TextButton upbutton = new TextButton(".." + directory.toString());
|
upbutton.left().add(upimage).padRight(4f).size(14 * 2);
|
||||||
upbutton.clicked(()->{
|
upbutton.getLabel().setAlignment(Align.left);
|
||||||
directory = directory.parent();
|
upbutton.getCells().reverse();
|
||||||
updateFiles(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
upbutton.left().add(upimage).padRight(4f).size(14*2);
|
files.add(upbutton).align(Align.topLeft).fillX().expandX().height(50).pad(2).colspan(2);
|
||||||
upbutton.getCells().reverse();
|
files.row();
|
||||||
|
}
|
||||||
files.top().left().add(upbutton).align(Align.topLeft).fillX().expandX().height(50).pad(2).colspan(2);
|
|
||||||
upbutton.getLabel().setAlignment(Align.left);
|
|
||||||
|
|
||||||
files.row();
|
|
||||||
|
|
||||||
ButtonGroup<TextButton> group = new ButtonGroup<TextButton>();
|
ButtonGroup<TextButton> group = new ButtonGroup<TextButton>();
|
||||||
group.setMinCheckCount(0);
|
group.setMinCheckCount(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user