Commit ec639c87 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed resize error on wb_wge and xtt_ge widgets.

parent 6c17e476
...@@ -150,23 +150,9 @@ WGeQt::~WGeQt() ...@@ -150,23 +150,9 @@ WGeQt::~WGeQt()
} }
} }
void WGeQtWidget::resize(int width, int height)
{
int default_width;
int default_height;
default_width = width + 20;
default_height = height + 20;
default_height = MIN(default_height, width * 0.95);
default_height = MAX(default_height, width * 1.05);
QWidget::resize(default_width, default_height);
}
void WGeQt::set_size(int width, int height) void WGeQt::set_size(int width, int height)
{ {
toplevel->resize(width, height); toplevel->resize(width + 20, height + 20);
} }
void WGeQt::set_subwindow_release() void WGeQt::set_subwindow_release()
......
...@@ -81,8 +81,6 @@ public: ...@@ -81,8 +81,6 @@ public:
{ {
} }
void resize(int width, int height);
protected: protected:
void focusInEvent(QFocusEvent* event); void focusInEvent(QFocusEvent* event);
void closeEvent(QCloseEvent* event); void closeEvent(QCloseEvent* event);
......
...@@ -46,15 +46,12 @@ CLogNavQt::CLogNavQt( ...@@ -46,15 +46,12 @@ CLogNavQt::CLogNavQt(
void* clog_parent_ctx, QWidget* clog_parent_wid, QWidget** w) void* clog_parent_ctx, QWidget* clog_parent_wid, QWidget** w)
: CLogNav(clog_parent_ctx) : CLogNav(clog_parent_ctx)
{ {
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget); form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
*w = form_widget; *w = form_widget;
} }
CLogNavQt::~CLogNavQt() CLogNavQt::~CLogNavQt()
{ {
debug_print("CLogNavQt::~CLogNavQt\n");
delete brow; delete brow;
form_widget->close(); form_widget->close();
} }
......
...@@ -75,27 +75,9 @@ void XttGeQt::set_below(int val) ...@@ -75,27 +75,9 @@ void XttGeQt::set_below(int val)
toplevel->windowFlags() | Qt::WindowStaysOnBottomHint); toplevel->windowFlags() | Qt::WindowStaysOnBottomHint);
} }
void XttGeQtWidget::resize(int width, int height)
{
int default_width;
int default_height;
float rd = 0.05;
;
default_width = width + 20;
default_height = height + 20;
if (width < 300 || height < 300) {
rd = 0.2;
}
default_height = MIN(default_height, width * (1.0 + rd));
default_height = MAX(default_height, width * (1.0 - rd));
QWidget::resize(default_width, default_height);
}
void XttGeQt::set_size(int width, int height) void XttGeQt::set_size(int width, int height)
{ {
toplevel->resize(width, height); toplevel->resize(width + 20, height + 20);
} }
void XttGeQt::ge_change_value_cb(void* ge_ctx, void* value_object, char* text) void XttGeQt::ge_change_value_cb(void* ge_ctx, void* value_object, char* text)
...@@ -294,7 +276,6 @@ XttGeQt::XttGeQt(QWidget* xg_parent_wid, void* xg_parent_ctx, ...@@ -294,7 +276,6 @@ XttGeQt::XttGeQt(QWidget* xg_parent_wid, void* xg_parent_ctx,
if (options & ge_mOptions_Dialog) { if (options & ge_mOptions_Dialog) {
toplevel->setWindowFlags(Qt::Dialog); toplevel->setWindowFlags(Qt::Dialog);
toplevel->setMinimumSize(window_width, window_height);
} }
CoWowQt::SetWindowIcon(toplevel); CoWowQt::SetWindowIcon(toplevel);
......
...@@ -101,8 +101,6 @@ public: ...@@ -101,8 +101,6 @@ public:
{ {
} }
void resize(int width, int height);
protected: protected:
void focusInEvent(QFocusEvent* event); void focusInEvent(QFocusEvent* event);
void closeEvent(QCloseEvent* event); void closeEvent(QCloseEvent* event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment