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