Skip to content

Commit

Permalink
feature: add scrollbar to "Open Trades" tab
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetBearKiller committed Nov 19, 2023
1 parent f6f4fb0 commit e785272
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
<?import com.jfoenix.controls.JFXTabPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.control.ScrollPane?>
<JFXTabPane fx:id="root" fx:controller="haveno.desktop.main.portfolio.PortfolioView"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml">

<Tab fx:id="openOffersTab" closable="false"/>
<Tab fx:id="pendingTradesTab" closable="false"/>
<Tab fx:id="pendingTradesTab" closable="false">
<ScrollPane fitToWidth="true" hbarPolicy="NEVER"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
</Tab>
<Tab fx:id="closedTradesTab" closable="false"/>

</JFXTabPane>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import javafx.beans.value.ChangeListener;
import javafx.collections.ListChangeListener;
import javafx.fxml.FXML;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;

Expand Down Expand Up @@ -232,7 +233,12 @@ private void loadView(Class<? extends View> viewClass, @Nullable Object data) {
}
}

currentTab.setContent(view.getRoot());
if (currentTab.getContent() != null && currentTab.getContent() instanceof ScrollPane) {
((ScrollPane) currentTab.getContent()).setContent(view.getRoot());
} else {
currentTab.setContent(view.getRoot());
}

root.getSelectionModel().select(currentTab);
}

Expand Down

0 comments on commit e785272

Please sign in to comment.