mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Prevent being able to scroll options panel
This commit is contained in:
@@ -381,7 +381,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float layoutOptionsPanel(float visibleWidth, float height) {
|
||||
protected void layoutOptionsPanel(float width, float height) {
|
||||
float padding = ItemFilter.PADDING;
|
||||
float x = 0;
|
||||
float h = FTextField.getDefaultHeight(ItemFilter.DEFAULT_FONT);
|
||||
@@ -393,7 +393,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
|
||||
//determine width of combo boxes based on available width versus auto-size widths
|
||||
float lblPileByWidth = lblPileBy.getAutoSizeBounds().width;
|
||||
float availableComboBoxWidth = visibleWidth - x - lblPileByWidth - padding;
|
||||
float availableComboBoxWidth = width - x - lblPileByWidth - padding;
|
||||
float groupByWidth = availableComboBoxWidth * 0.6f;
|
||||
float pileByWidth = availableComboBoxWidth - groupByWidth;
|
||||
|
||||
@@ -402,9 +402,6 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
lblPileBy.setBounds(x, y, lblPileByWidth, h);
|
||||
x += lblPileByWidth;
|
||||
cbPileByOptions.setBounds(x, y, pileByWidth, h);
|
||||
x += pileByWidth + padding;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
private void updateLayout(boolean forRefresh) {
|
||||
|
||||
@@ -209,8 +209,7 @@ public final class ItemListView<T extends InventoryItem> extends ItemView<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float layoutOptionsPanel(float visibleWidth, float height) {
|
||||
return visibleWidth;
|
||||
protected void layoutOptionsPanel(float width, float height) {
|
||||
}
|
||||
|
||||
public final class ItemList extends FList<Entry<T, Integer>> {
|
||||
|
||||
@@ -10,6 +10,7 @@ import forge.itemmanager.ItemColumn;
|
||||
import forge.itemmanager.ItemManager;
|
||||
import forge.itemmanager.ItemManagerConfig;
|
||||
import forge.itemmanager.ItemManagerModel;
|
||||
import forge.toolbox.FContainer;
|
||||
import forge.toolbox.FEvent;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FEvent.FEventType;
|
||||
@@ -86,18 +87,12 @@ public abstract class ItemView<T extends InventoryItem> {
|
||||
return false;
|
||||
}
|
||||
protected abstract float getScrollHeight();
|
||||
protected abstract float layoutOptionsPanel(float visibleWidth, float height);
|
||||
protected abstract void layoutOptionsPanel(float visibleWidth, float height);
|
||||
|
||||
private class OptionsPanel extends FScrollPane {
|
||||
private class OptionsPanel extends FContainer {
|
||||
@Override
|
||||
protected ScrollBounds layoutAndGetScrollBounds(float visibleWidth, float visibleHeight) {
|
||||
return new ScrollBounds(layoutOptionsPanel(visibleWidth, visibleHeight), visibleHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawOverlay(Graphics g) {
|
||||
super.drawOverlay(g);
|
||||
g.drawLine(1, BORDER_COLOR, 0, 0, getWidth(), 0);
|
||||
protected void doLayout(float width, float height) {
|
||||
layoutOptionsPanel(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +118,7 @@ public abstract class ItemView<T extends InventoryItem> {
|
||||
return scroller;
|
||||
}
|
||||
|
||||
public FScrollPane getPnlOptions() {
|
||||
public FContainer getPnlOptions() {
|
||||
return pnlOptions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user