mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Fixes STR #3352: "tiny window problem if child group larger than window"
This commit is contained in:
+5
-3
@@ -2954,9 +2954,11 @@ Fl_X* Fl_Cocoa_Window_Driver::makeWindow()
|
|||||||
} else {
|
} else {
|
||||||
if (w->resizable()) {
|
if (w->resizable()) {
|
||||||
Fl_Widget *o = w->resizable();
|
Fl_Widget *o = w->resizable();
|
||||||
int minw = o->w(); if (minw > 100) minw = 100;
|
int minw = w->w(); // minw is window's initial width
|
||||||
int minh = o->h(); if (minh > 100) minh = 100;
|
int minh = w->h(); // minh is window's initial height
|
||||||
w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0);
|
int maxw = (o->w() == 0) ? minw : 0; // if resizable w()==0, disable resize w()
|
||||||
|
int maxh = (o->h() == 0) ? minh : 0; // if resizable h()==0, disable resize h()
|
||||||
|
w->size_range(minw, minh, maxw, maxh);
|
||||||
if (w->border()) winstyle |= NSResizableWindowMask;
|
if (w->border()) winstyle |= NSResizableWindowMask;
|
||||||
} else {
|
} else {
|
||||||
w->size_range(w->w(), w->h(), w->w(), w->h());
|
w->size_range(w->w(), w->h(), w->w(), w->h());
|
||||||
|
|||||||
+6
-8
@@ -2069,14 +2069,12 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() {
|
|||||||
} else {
|
} else {
|
||||||
if (!size_range_set()) {
|
if (!size_range_set()) {
|
||||||
if (w->resizable()) {
|
if (w->resizable()) {
|
||||||
Fl_Widget *o = w->resizable();
|
Fl_Widget *o = w->resizable();
|
||||||
int minw = o->w();
|
int minw = w->w(); // minw is window's initial width
|
||||||
if (minw > 100)
|
int minh = w->h(); // minh is window's initial height
|
||||||
minw = 100;
|
int maxw = (o->w() == 0) ? minw : 0; // if resizable w()==0, disable resize w()
|
||||||
int minh = o->h();
|
int maxh = (o->h() == 0) ? minh : 0; // if resizable h()==0, disable resize h()
|
||||||
if (minh > 100)
|
w->size_range(minw, minh, maxw, maxh);
|
||||||
minh = 100;
|
|
||||||
w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0);
|
|
||||||
} else {
|
} else {
|
||||||
w->size_range(w->w(), w->h(), w->w(), w->h());
|
w->size_range(w->w(), w->h(), w->w(), w->h());
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -2791,9 +2791,11 @@ void Fl_X11_Window_Driver::sendxjunk() {
|
|||||||
if (!size_range_set()) { // default size_range based on resizable():
|
if (!size_range_set()) { // default size_range based on resizable():
|
||||||
if (w->resizable()) {
|
if (w->resizable()) {
|
||||||
Fl_Widget *o = w->resizable();
|
Fl_Widget *o = w->resizable();
|
||||||
int minw = o->w(); if (minw > 100) minw = 100;
|
int minw = w->w(); // minw is window's initial width
|
||||||
int minh = o->h(); if (minh > 100) minh = 100;
|
int minh = w->h(); // minh is window's initial height
|
||||||
w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0);
|
int maxw = (o->w() == 0) ? minw : 0; // if resizable w()==0, disable resize w()
|
||||||
|
int maxh = (o->h() == 0) ? minh : 0; // if resizable h()==0, disable resize h()
|
||||||
|
w->size_range(minw, minh, maxw, maxh);
|
||||||
} else {
|
} else {
|
||||||
w->size_range(w->w(), w->h(), w->w(), w->h());
|
w->size_range(w->w(), w->h(), w->w(), w->h());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user