Merge pull request #766 from undso/issue_755

Scale GUI to fit in 1024x700 pixel #755
This commit is contained in:
Manfred Karrer 2017-03-05 17:19:02 -05:00 committed by GitHub
commit 20189b7128
2 changed files with 28 additions and 6 deletions

View File

@ -17,15 +17,32 @@
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
-->
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.AnchorPane?>
<TabPane fx:id="root" fx:controller="io.bitsquare.gui.main.settings.SettingsView"
AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0"
AnchorPane.rightAnchor="0" AnchorPane.topAnchor="0"
xmlns:fx="http://javafx.com/fxml">
<Tab fx:id="preferencesTab" text="Settings" closable="false"/>
<Tab fx:id="networkSettingsTab" text="Network info" closable="false"/>
<Tab fx:id="aboutTab" text="About" closable="false"/>
<Tab fx:id="preferencesTab" text="Settings" closable="false">
<content>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
</content>
</Tab>
<Tab fx:id="networkSettingsTab" text="Network info" closable="false">
<content>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
</content>
</Tab>
<Tab fx:id="aboutTab" text="About" closable="false">
<content>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
</content>
</Tab>
</TabPane>

View File

@ -26,6 +26,7 @@ import io.bitsquare.gui.main.settings.network.NetworkSettingsView;
import io.bitsquare.gui.main.settings.preferences.PreferencesView;
import javafx.beans.value.ChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
@ -92,7 +93,11 @@ public class SettingsView extends ActivatableViewAndModel<TabPane, Activatable>
else if (view instanceof AboutView) tab = aboutTab;
else throw new IllegalArgumentException("Navigation to " + viewClass + " is not supported");
tab.setContent(view.getRoot());
if (tab.getContent() != null && tab.getContent() instanceof ScrollPane) {
((ScrollPane) tab.getContent()).setContent(view.getRoot());
} else {
tab.setContent(view.getRoot());
}
root.getSelectionModel().select(tab);
}
}