From 2bf3dbf375e258cdbc2cfb932b8a03d6570a732f Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 23 Mar 2011 19:04:37 +1100 Subject: [PATCH] Update to v077r03 release. byuu says: Fixed up the geometry calculation code. There is now minimumGeometry() [returns minimum size needed to display a layout, treats MaximumSize as MinimumSize], and minimumLayoutGeometry() [like minimumGeometry(), but it will return MaximumSize if a single container item has that attribute. Used mostly internally for layout sizing.] It looks great on Windows, but it looks visually off on Qt. Not exactly sure what's up there. When I make a test application, everything looks great. Going to have to clone a bsnes window that's having a problem (eg bsnes main debugger checkbox window), and see what's up. --- .../phoenix/core/layout/horizontal-layout.cpp | 100 ++++++++++++------ .../phoenix/core/layout/horizontal-layout.hpp | 3 +- bsnes/phoenix/core/layout/vertical-layout.cpp | 100 ++++++++++++------ bsnes/phoenix/core/layout/vertical-layout.hpp | 3 +- .../phoenix/gtk/widget/horizontal-slider.cpp | 2 +- bsnes/phoenix/gtk/widget/progress-bar.cpp | 2 +- bsnes/phoenix/gtk/widget/vertical-slider.cpp | 2 +- bsnes/phoenix/gtk/widget/widget.cpp | 2 +- bsnes/phoenix/qt/qt.moc | 2 +- bsnes/phoenix/qt/widget/horizontal-slider.cpp | 2 +- bsnes/phoenix/qt/widget/progress-bar.cpp | 2 +- bsnes/phoenix/qt/widget/vertical-slider.cpp | 2 +- bsnes/phoenix/qt/widget/widget.cpp | 2 +- bsnes/phoenix/windows/font.cpp | 4 + bsnes/phoenix/windows/widget/button.cpp | 2 +- bsnes/phoenix/windows/widget/check-box.cpp | 2 +- bsnes/phoenix/windows/widget/combo-box.cpp | 3 +- .../windows/widget/horizontal-slider.cpp | 2 +- bsnes/phoenix/windows/widget/label.cpp | 2 +- bsnes/phoenix/windows/widget/line-edit.cpp | 2 +- bsnes/phoenix/windows/widget/progress-bar.cpp | 2 +- bsnes/phoenix/windows/widget/radio-box.cpp | 2 +- .../windows/widget/vertical-slider.cpp | 2 +- bsnes/phoenix/windows/widget/widget.cpp | 2 +- bsnes/phoenix/windows/windows.hpp | 1 + bsnes/snes/snes.hpp | 2 +- bsnes/ui/debugger/console.cpp | 2 +- bsnes/ui/debugger/debugger.cpp | 2 +- bsnes/ui/debugger/tools/breakpoint-editor.cpp | 2 +- 29 files changed, 162 insertions(+), 96 deletions(-) diff --git a/bsnes/phoenix/core/layout/horizontal-layout.cpp b/bsnes/phoenix/core/layout/horizontal-layout.cpp index 14cd0ea1..7e4336f2 100755 --- a/bsnes/phoenix/core/layout/horizontal-layout.cpp +++ b/bsnes/phoenix/core/layout/horizontal-layout.cpp @@ -1,5 +1,5 @@ void HorizontalLayout::append(VerticalLayout &layout, unsigned spacing) { - children.append({ &layout, 0, 0, 0, spacing }); + children.append({ &layout, 0, MinimumSize, MinimumSize, spacing }); } void HorizontalLayout::append(Widget &widget, unsigned width, unsigned height, unsigned spacing) { @@ -7,26 +7,81 @@ void HorizontalLayout::append(Widget &widget, unsigned width, unsigned height, u } Geometry HorizontalLayout::minimumGeometry() { + unsigned width = 0, height = 0; + + foreach(child, children) { + width += child.spacing; + if(child.width == MinimumSize || child.width == MaximumSize) { + if(child.layout) width += child.layout->minimumGeometry().width; + if(child.widget) width += child.widget->minimumGeometry().width; + continue; + } + width += child.width; + } + + foreach(child, children) { + if(child.height == MinimumSize || child.height == MaximumSize) { + if(child.layout) height = max(height, child.layout->minimumGeometry().height); + if(child.widget) height = max(height, child.widget->minimumGeometry().height); + continue; + } + height = max(height, child.height); + } + + return { 0, 0, margin * 2 + width, margin * 2 + height }; +} + +Geometry HorizontalLayout::minimumLayoutGeometry() { + unsigned width = 0, height = 0; bool maximumWidth = false; bool maximumHeight = false; - unsigned width = margin * 2; - unsigned height = margin * 2; - foreach(child, children) { - if(child.width == MaximumSize) maximumWidth = true; - if(child.height == MaximumSize) maximumHeight = true; + if(child.width == MaximumSize) { + maximumWidth = true; + break; + } - if(child.width != MaximumSize) width += child.width; - if(child.height != MaximumSize) height = max(height, child.height); + if(child.width == MinimumSize) { + if(child.layout) width += child.layout->minimumGeometry().width; + if(child.widget) width += child.widget->minimumGeometry().width; + continue; + } + + width += child.width; } - return { 0, 0, maximumWidth ? MaximumSize : width, maximumHeight ? MaximumSize : height }; + foreach(child, children) { + if(child.height == MaximumSize) { + maximumHeight = true; + break; + } + + if(child.height == MinimumSize) { + if(child.layout) height = max(height, child.layout->minimumGeometry().height); + if(child.widget) height = max(height, child.widget->minimumGeometry().height); + continue; + } + + height = max(height, child.height); + } + + return { 0, 0, maximumWidth ? MaximumSize : margin * 2 + width, maximumHeight ? MaximumSize : margin * 2 + height }; } void HorizontalLayout::setGeometry(const Geometry &containerGeometry) { - setMinimumGeometry(); - setLayoutGeometry(); + auto children = this->children; + foreach(child, children) { + if(child.layout) { + child.width = child.layout->minimumLayoutGeometry().width; + child.height = child.layout->minimumLayoutGeometry().height; + } + + if(child.widget) { + if(child.width == MinimumSize) child.width = child.widget->minimumGeometry().width; + if(child.height == MinimumSize) child.height = child.widget->minimumGeometry().height; + } + } Geometry geometry = containerGeometry; geometry.x += margin; @@ -34,9 +89,6 @@ void HorizontalLayout::setGeometry(const Geometry &containerGeometry) { geometry.width -= margin * 2; geometry.height -= margin * 2; - Geometry layoutGeometry = geometry; - auto children = this->children; - unsigned minimumWidth = 0, maximumWidthCounter = 0; foreach(child, children) { if(child.width == MaximumSize) maximumWidthCounter++; @@ -64,30 +116,10 @@ void HorizontalLayout::setGeometry(const Geometry &containerGeometry) { } } -void HorizontalLayout::setLayoutGeometry() { - foreach(child, children) { - if(child.layout) { - child.width = child.layout->minimumGeometry().width; - child.height = child.layout->minimumGeometry().height; - } - } -} - void HorizontalLayout::setMargin(unsigned margin) { this->margin = margin; } -void HorizontalLayout::setMinimumGeometry() { - foreach(child, children) { - if(child.layout) child.layout->setMinimumGeometry(); - if(child.widget) { - Geometry minimumGeometry = child.widget->minimumGeometry(); - if(child.width == MinimumSize) child.width = minimumGeometry.width; - if(child.height == MinimumSize) child.height = minimumGeometry.height; - } - } -} - void HorizontalLayout::setParent(Window &parent) { foreach(child, children) { if(child.layout) child.layout->setParent(parent); diff --git a/bsnes/phoenix/core/layout/horizontal-layout.hpp b/bsnes/phoenix/core/layout/horizontal-layout.hpp index 3eb14d93..d8faf3f5 100755 --- a/bsnes/phoenix/core/layout/horizontal-layout.hpp +++ b/bsnes/phoenix/core/layout/horizontal-layout.hpp @@ -3,11 +3,10 @@ struct VerticalLayout; struct HorizontalLayout : public Layout { void append(VerticalLayout &layout, unsigned spacing = 0); void append(Widget &widget, unsigned width, unsigned height, unsigned spacing = 0); + Geometry minimumLayoutGeometry(); Geometry minimumGeometry(); void setGeometry(const Geometry &geometry); - void setLayoutGeometry(); void setMargin(unsigned margin); - void setMinimumGeometry(); void setParent(Window &parent); void setVisible(bool visible); HorizontalLayout(); diff --git a/bsnes/phoenix/core/layout/vertical-layout.cpp b/bsnes/phoenix/core/layout/vertical-layout.cpp index 3a6f54e9..373c8249 100755 --- a/bsnes/phoenix/core/layout/vertical-layout.cpp +++ b/bsnes/phoenix/core/layout/vertical-layout.cpp @@ -1,5 +1,5 @@ void VerticalLayout::append(HorizontalLayout &layout, unsigned spacing) { - children.append({ &layout, 0, 0, 0, spacing }); + children.append({ &layout, 0, MinimumSize, MinimumSize, spacing }); } void VerticalLayout::append(Widget &widget, unsigned width, unsigned height, unsigned spacing) { @@ -7,26 +7,81 @@ void VerticalLayout::append(Widget &widget, unsigned width, unsigned height, uns } Geometry VerticalLayout::minimumGeometry() { + unsigned width = 0, height = 0; + + foreach(child, children) { + if(child.width == MinimumSize || child.width == MaximumSize) { + if(child.layout) width = max(width, child.layout->minimumGeometry().width); + if(child.widget) width = max(width, child.widget->minimumGeometry().width); + continue; + } + width = max(width, child.width); + } + + foreach(child, children) { + height += child.spacing; + if(child.height == MinimumSize || child.height == MaximumSize) { + if(child.layout) height += child.layout->minimumGeometry().height; + if(child.widget) height += child.widget->minimumGeometry().height; + continue; + } + height += child.height; + } + + return { 0, 0, margin * 2 + width, margin * 2 + height }; +} + +Geometry VerticalLayout::minimumLayoutGeometry() { + unsigned width = 0, height = 0; bool maximumWidth = false; bool maximumHeight = false; - unsigned width = margin * 2; - unsigned height = margin * 2; - foreach(child, children) { - if(child.width == MaximumSize) maximumWidth = true; - if(child.height == MaximumSize) maximumHeight = true; + if(child.width == MaximumSize) { + maximumWidth = true; + break; + } - if(child.width != MaximumSize) width = max(width, child.width); - if(child.height != MaximumSize) height += child.height; + if(child.width == MinimumSize) { + if(child.layout) width = max(width, child.layout->minimumGeometry().width); + if(child.widget) width = max(width, child.widget->minimumGeometry().width); + continue; + } + + width = max(width, child.width); } - return { 0, 0, maximumWidth ? MaximumSize : width, maximumHeight ? MaximumSize : height }; + foreach(child, children) { + if(child.height == MaximumSize) { + maximumHeight = true; + break; + } + + if(child.height == MinimumSize) { + if(child.layout) height += child.layout->minimumGeometry().height; + if(child.widget) height += child.widget->minimumGeometry().height; + continue; + } + + height += child.height; + } + + return { 0, 0, maximumWidth ? MaximumSize : margin * 2 + width, maximumHeight ? MaximumSize : margin * 2 + height }; } void VerticalLayout::setGeometry(const Geometry &containerGeometry) { - setMinimumGeometry(); - setLayoutGeometry(); + auto children = this->children; + foreach(child, children) { + if(child.layout) { + child.width = child.layout->minimumLayoutGeometry().width; + child.height = child.layout->minimumLayoutGeometry().height; + } + + if(child.widget) { + if(child.width == MinimumSize) child.width = child.widget->minimumGeometry().width; + if(child.height == MinimumSize) child.height = child.widget->minimumGeometry().height; + } + } Geometry geometry = containerGeometry; geometry.x += margin; @@ -34,9 +89,6 @@ void VerticalLayout::setGeometry(const Geometry &containerGeometry) { geometry.width -= margin * 2; geometry.height -= margin * 2; - Geometry layoutGeometry = geometry; - auto children = this->children; - unsigned minimumHeight = 0, maximumHeightCounter = 0; foreach(child, children) { if(child.height == MaximumSize) maximumHeightCounter++; @@ -64,30 +116,10 @@ void VerticalLayout::setGeometry(const Geometry &containerGeometry) { } } -void VerticalLayout::setLayoutGeometry() { - foreach(child, children) { - if(child.layout) { - child.width = child.layout->minimumGeometry().width; - child.height = child.layout->minimumGeometry().height; - } - } -} - void VerticalLayout::setMargin(unsigned margin) { this->margin = margin; } -void VerticalLayout::setMinimumGeometry() { - foreach(child, children) { - if(child.layout) child.layout->setMinimumGeometry(); - if(child.widget) { - Geometry minimumGeometry = child.widget->minimumGeometry(); - if(child.width == MinimumSize) child.width = minimumGeometry.width; - if(child.height == MinimumSize) child.height = minimumGeometry.height; - } - } -} - void VerticalLayout::setParent(Window &parent) { foreach(child, children) { if(child.layout) child.layout->setParent(parent); diff --git a/bsnes/phoenix/core/layout/vertical-layout.hpp b/bsnes/phoenix/core/layout/vertical-layout.hpp index 13b2bedb..a280c269 100755 --- a/bsnes/phoenix/core/layout/vertical-layout.hpp +++ b/bsnes/phoenix/core/layout/vertical-layout.hpp @@ -4,10 +4,9 @@ struct VerticalLayout : public Layout { void append(HorizontalLayout &layout, unsigned spacing = 0); void append(Widget &widget, unsigned width, unsigned height, unsigned spacing = 0); Geometry minimumGeometry(); + Geometry minimumLayoutGeometry(); void setGeometry(const Geometry &geometry); - void setLayoutGeometry(); void setMargin(unsigned margin); - void setMinimumGeometry(); void setParent(Window &parent); void setVisible(bool visible); VerticalLayout(); diff --git a/bsnes/phoenix/gtk/widget/horizontal-slider.cpp b/bsnes/phoenix/gtk/widget/horizontal-slider.cpp index 07771f36..89a17a8a 100755 --- a/bsnes/phoenix/gtk/widget/horizontal-slider.cpp +++ b/bsnes/phoenix/gtk/widget/horizontal-slider.cpp @@ -5,7 +5,7 @@ static void HorizontalSlider_change(HorizontalSlider *self) { } Geometry pHorizontalSlider::minimumGeometry() { - return { 0, 0, 100, 20 }; + return { 0, 0, 0, 20 }; } unsigned pHorizontalSlider::position() { diff --git a/bsnes/phoenix/gtk/widget/progress-bar.cpp b/bsnes/phoenix/gtk/widget/progress-bar.cpp index 721587a4..4e7d752c 100755 --- a/bsnes/phoenix/gtk/widget/progress-bar.cpp +++ b/bsnes/phoenix/gtk/widget/progress-bar.cpp @@ -1,5 +1,5 @@ Geometry pProgressBar::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 25 }; } void pProgressBar::setPosition(unsigned position) { diff --git a/bsnes/phoenix/gtk/widget/vertical-slider.cpp b/bsnes/phoenix/gtk/widget/vertical-slider.cpp index 028abcea..b19632f7 100755 --- a/bsnes/phoenix/gtk/widget/vertical-slider.cpp +++ b/bsnes/phoenix/gtk/widget/vertical-slider.cpp @@ -5,7 +5,7 @@ static void VerticalSlider_change(VerticalSlider *self) { } Geometry pVerticalSlider::minimumGeometry() { - return { 0, 0, 20, 100 }; + return { 0, 0, 20, 0 }; } unsigned pVerticalSlider::position() { diff --git a/bsnes/phoenix/gtk/widget/widget.cpp b/bsnes/phoenix/gtk/widget/widget.cpp index 9a21a02c..62bb46f4 100755 --- a/bsnes/phoenix/gtk/widget/widget.cpp +++ b/bsnes/phoenix/gtk/widget/widget.cpp @@ -12,7 +12,7 @@ Font& pWidget::font() { } Geometry pWidget::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 0 }; } bool pWidget::enabled() { diff --git a/bsnes/phoenix/qt/qt.moc b/bsnes/phoenix/qt/qt.moc index f1b11619..3d6067d5 100755 --- a/bsnes/phoenix/qt/qt.moc +++ b/bsnes/phoenix/qt/qt.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'qt.moc.hpp' ** -** Created: Mon Mar 21 22:59:16 2011 +** Created: Wed Mar 23 03:03:27 2011 ** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0) ** ** WARNING! All changes made in this file will be lost! diff --git a/bsnes/phoenix/qt/widget/horizontal-slider.cpp b/bsnes/phoenix/qt/widget/horizontal-slider.cpp index 05b13578..b29eab7b 100755 --- a/bsnes/phoenix/qt/widget/horizontal-slider.cpp +++ b/bsnes/phoenix/qt/widget/horizontal-slider.cpp @@ -1,5 +1,5 @@ Geometry pHorizontalSlider::minimumGeometry() { - return { 0, 0, 100, 20 }; + return { 0, 0, 0, 20 }; } unsigned pHorizontalSlider::position() { diff --git a/bsnes/phoenix/qt/widget/progress-bar.cpp b/bsnes/phoenix/qt/widget/progress-bar.cpp index c8051e5a..698c587e 100755 --- a/bsnes/phoenix/qt/widget/progress-bar.cpp +++ b/bsnes/phoenix/qt/widget/progress-bar.cpp @@ -1,5 +1,5 @@ Geometry pProgressBar::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 25 }; } void pProgressBar::setPosition(unsigned position) { diff --git a/bsnes/phoenix/qt/widget/vertical-slider.cpp b/bsnes/phoenix/qt/widget/vertical-slider.cpp index a9f6e8e5..10c05e50 100755 --- a/bsnes/phoenix/qt/widget/vertical-slider.cpp +++ b/bsnes/phoenix/qt/widget/vertical-slider.cpp @@ -1,5 +1,5 @@ Geometry pVerticalSlider::minimumGeometry() { - return { 0, 0, 20, 100 }; + return { 0, 0, 20, 0 }; } unsigned pVerticalSlider::position() { diff --git a/bsnes/phoenix/qt/widget/widget.cpp b/bsnes/phoenix/qt/widget/widget.cpp index 875b4fab..e9723fef 100755 --- a/bsnes/phoenix/qt/widget/widget.cpp +++ b/bsnes/phoenix/qt/widget/widget.cpp @@ -4,7 +4,7 @@ Font& pWidget::font() { } Geometry pWidget::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 0 }; } void pWidget::setEnabled(bool enabled) { diff --git a/bsnes/phoenix/windows/font.cpp b/bsnes/phoenix/windows/font.cpp index 10d36580..60d417ee 100755 --- a/bsnes/phoenix/windows/font.cpp +++ b/bsnes/phoenix/windows/font.cpp @@ -15,6 +15,10 @@ Geometry pFont::geometry(const string &text) { return { 0, 0, rc.right, rc.bottom }; } +unsigned pFont::height() { + return geometry(" ").height; +} + void pFont::setBold(bool bold) { if(hfont) { DeleteObject(hfont); hfont = 0; } hfont = Font_createFont(font.state.family, font.state.size, font.state.bold, font.state.italic, font.state.underline); diff --git a/bsnes/phoenix/windows/widget/button.cpp b/bsnes/phoenix/windows/widget/button.cpp index 2c0a5d36..b9615dc0 100755 --- a/bsnes/phoenix/windows/widget/button.cpp +++ b/bsnes/phoenix/windows/widget/button.cpp @@ -1,7 +1,7 @@ Geometry pButton::minimumGeometry() { Font &font = this->font(); Geometry geometry = font.geometry(button.state.text); - return { 0, 0, geometry.width + 20, geometry.height + 12 }; + return { 0, 0, geometry.width + 20, font.p.height() + 12 }; } void pButton::setText(const string &text) { diff --git a/bsnes/phoenix/windows/widget/check-box.cpp b/bsnes/phoenix/windows/widget/check-box.cpp index 886d78ca..0f21b052 100755 --- a/bsnes/phoenix/windows/widget/check-box.cpp +++ b/bsnes/phoenix/windows/widget/check-box.cpp @@ -5,7 +5,7 @@ bool pCheckBox::checked() { Geometry pCheckBox::minimumGeometry() { Font &font = this->font(); Geometry geometry = font.geometry(checkBox.state.text); - return { 0, 0, geometry.width + 20, geometry.height + 4 }; + return { 0, 0, geometry.width + 20, font.p.height() + 4 }; } void pCheckBox::setChecked(bool checked) { diff --git a/bsnes/phoenix/windows/widget/combo-box.cpp b/bsnes/phoenix/windows/widget/combo-box.cpp index db823947..88d81264 100755 --- a/bsnes/phoenix/windows/widget/combo-box.cpp +++ b/bsnes/phoenix/windows/widget/combo-box.cpp @@ -7,8 +7,7 @@ Geometry pComboBox::minimumGeometry() { Font &font = this->font(); unsigned maximumWidth = 0; foreach(text, comboBox.state.text) maximumWidth = max(maximumWidth, font.geometry(text).width); - Geometry geometry = font.geometry(" "); - return { 0, 0, maximumWidth + 24, geometry.height + 10 }; + return { 0, 0, maximumWidth + 24, font.p.height() + 10 }; } void pComboBox::reset() { diff --git a/bsnes/phoenix/windows/widget/horizontal-slider.cpp b/bsnes/phoenix/windows/widget/horizontal-slider.cpp index f1f3f956..c660be1e 100755 --- a/bsnes/phoenix/windows/widget/horizontal-slider.cpp +++ b/bsnes/phoenix/windows/widget/horizontal-slider.cpp @@ -1,5 +1,5 @@ Geometry pHorizontalSlider::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 25 }; } unsigned pHorizontalSlider::position() { diff --git a/bsnes/phoenix/windows/widget/label.cpp b/bsnes/phoenix/windows/widget/label.cpp index dc40ed61..1c13b70c 100755 --- a/bsnes/phoenix/windows/widget/label.cpp +++ b/bsnes/phoenix/windows/widget/label.cpp @@ -1,7 +1,7 @@ Geometry pLabel::minimumGeometry() { Font &font = this->font(); Geometry geometry = font.geometry(label.state.text); - return { 0, 0, geometry.width, geometry.height }; + return { 0, 0, geometry.width, font.p.height() }; } void pLabel::setText(const string &text) { diff --git a/bsnes/phoenix/windows/widget/line-edit.cpp b/bsnes/phoenix/windows/widget/line-edit.cpp index d94ffd99..ded999ab 100755 --- a/bsnes/phoenix/windows/widget/line-edit.cpp +++ b/bsnes/phoenix/windows/widget/line-edit.cpp @@ -1,7 +1,7 @@ Geometry pLineEdit::minimumGeometry() { Font &font = this->font(); Geometry geometry = font.geometry(lineEdit.state.text); - return { 0, 0, geometry.width + 12, geometry.height + 8 }; + return { 0, 0, geometry.width + 12, font.p.height() + 8 }; } void pLineEdit::setEditable(bool editable) { diff --git a/bsnes/phoenix/windows/widget/progress-bar.cpp b/bsnes/phoenix/windows/widget/progress-bar.cpp index 530dfbb2..495cb440 100755 --- a/bsnes/phoenix/windows/widget/progress-bar.cpp +++ b/bsnes/phoenix/windows/widget/progress-bar.cpp @@ -1,5 +1,5 @@ Geometry pProgressBar::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 25 }; } void pProgressBar::setPosition(unsigned position) { diff --git a/bsnes/phoenix/windows/widget/radio-box.cpp b/bsnes/phoenix/windows/widget/radio-box.cpp index 0efbce1a..b135f87e 100755 --- a/bsnes/phoenix/windows/widget/radio-box.cpp +++ b/bsnes/phoenix/windows/widget/radio-box.cpp @@ -5,7 +5,7 @@ bool pRadioBox::checked() { Geometry pRadioBox::minimumGeometry() { Font &font = this->font(); Geometry geometry = font.geometry(radioBox.state.text); - return { 0, 0, geometry.width + 20, geometry.height + 4 }; + return { 0, 0, geometry.width + 20, font.p.height() + 4 }; } void pRadioBox::setChecked() { diff --git a/bsnes/phoenix/windows/widget/vertical-slider.cpp b/bsnes/phoenix/windows/widget/vertical-slider.cpp index f8da0ec9..8c170cdf 100755 --- a/bsnes/phoenix/windows/widget/vertical-slider.cpp +++ b/bsnes/phoenix/windows/widget/vertical-slider.cpp @@ -1,5 +1,5 @@ Geometry pVerticalSlider::minimumGeometry() { - return { 0, 0, 25, 100 }; + return { 0, 0, 25, 0 }; } unsigned pVerticalSlider::position() { diff --git a/bsnes/phoenix/windows/widget/widget.cpp b/bsnes/phoenix/windows/widget/widget.cpp index a6af16ad..81f984f7 100755 --- a/bsnes/phoenix/windows/widget/widget.cpp +++ b/bsnes/phoenix/windows/widget/widget.cpp @@ -8,7 +8,7 @@ Font& pWidget::font() { } Geometry pWidget::minimumGeometry() { - return { 0, 0, 100, 25 }; + return { 0, 0, 0, 0 }; } void pWidget::setEnabled(bool enabled) { diff --git a/bsnes/phoenix/windows/windows.hpp b/bsnes/phoenix/windows/windows.hpp index 3e14d9ff..2d1aa6f3 100755 --- a/bsnes/phoenix/windows/windows.hpp +++ b/bsnes/phoenix/windows/windows.hpp @@ -38,6 +38,7 @@ struct pFont : public pObject { HFONT hfont; Geometry geometry(const string &text); + unsigned height(); void setBold(bool bold); void setFamily(const string &family); void setItalic(bool italic); diff --git a/bsnes/snes/snes.hpp b/bsnes/snes/snes.hpp index 602b2f0a..1b514fc2 100755 --- a/bsnes/snes/snes.hpp +++ b/bsnes/snes/snes.hpp @@ -1,7 +1,7 @@ namespace SNES { namespace Info { static const char Name[] = "bsnes"; - static const char Version[] = "077.02"; + static const char Version[] = "077.03"; static const unsigned SerializerVersion = 19; } } diff --git a/bsnes/ui/debugger/console.cpp b/bsnes/ui/debugger/console.cpp index 03a31cc4..fd2d3111 100755 --- a/bsnes/ui/debugger/console.cpp +++ b/bsnes/ui/debugger/console.cpp @@ -24,7 +24,7 @@ void Console::create() { controlLayout.append(clearConsole, 120, 0 ); layout.append(controlLayout ); - setGeometry({ 0, 0, layout.minimumGeometry().width + 580, 350 }); + setGeometry({ 0, 0, layout.minimumGeometry().width + 585, 350 }); append(layout); onClose = []() { diff --git a/bsnes/ui/debugger/debugger.cpp b/bsnes/ui/debugger/debugger.cpp index 95c811d3..301d4af4 100755 --- a/bsnes/ui/debugger/debugger.cpp +++ b/bsnes/ui/debugger/debugger.cpp @@ -36,7 +36,7 @@ void Debugger::create() { layout.append(showBreakpointEditor, ~0, 0); layout.append(showMemoryEditor, ~0, 0); - setGeometry({ 0, 0, 256, layout.minimumGeometry().height }); + setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height }); append(layout); //windows shown by default diff --git a/bsnes/ui/debugger/tools/breakpoint-editor.cpp b/bsnes/ui/debugger/tools/breakpoint-editor.cpp index cec01123..ebc4c73c 100755 --- a/bsnes/ui/debugger/tools/breakpoint-editor.cpp +++ b/bsnes/ui/debugger/tools/breakpoint-editor.cpp @@ -29,7 +29,7 @@ void BreakpointEditor::create() { layout.append(breakpointLayout[n], 5); } - setGeometry({ 0, 0, 310, layout.minimumGeometry().height }); + setGeometry({ 0, 0, layout.minimumGeometry().width, layout.minimumGeometry().height }); append(layout); onClose = []() {