Correction for height and width alignment in adjustSize()

This commit is contained in:
Markus Gans 2019-12-23 14:20:31 +01:00
parent 3a391f5fe5
commit 23ddf5d6f2
4 changed files with 27 additions and 40 deletions

View File

@ -1,4 +1,5 @@
2019-12-23 Markus Gans <guru.mail@muenster.de> 2019-12-23 Markus Gans <guru.mail@muenster.de>
* Correction for height and width alignment in adjustSize()
* Better setSize() implementation in some widgets * Better setSize() implementation in some widgets
2019-12-20 Markus Gans <guru.mail@muenster.de> 2019-12-20 Markus Gans <guru.mail@muenster.de>

View File

@ -142,36 +142,24 @@ Background::Background (finalcut::FWidget* parent)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
); );
red.addCallback for (const auto spinbox : {&red, &green, &blue})
( {
"changed", spinbox->addCallback
F_METHOD_CALLBACK (this, &Background::cb_changed)
);
green.addCallback
(
"changed",
F_METHOD_CALLBACK (this, &Background::cb_changed)
);
blue.addCallback
( (
"changed", "changed",
F_METHOD_CALLBACK (this, &Background::cb_changed) F_METHOD_CALLBACK (this, &Background::cb_changed)
); );
}
for (const auto& signal : {"row-changed", "clicked"})
{
color_choice.addCallback color_choice.addCallback
( (
"clicked", signal,
F_METHOD_CALLBACK (this, &Background::cb_choice)
);
color_choice.addCallback
(
"row-changed",
F_METHOD_CALLBACK (this, &Background::cb_choice) F_METHOD_CALLBACK (this, &Background::cb_choice)
); );
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
Background::~Background() // destructor Background::~Background() // destructor

View File

@ -512,18 +512,15 @@ void FComboBox::initCallbacks()
F_METHOD_CALLBACK (this, &FComboBox::cb_setInputField) F_METHOD_CALLBACK (this, &FComboBox::cb_setInputField)
); );
for (const auto& signal : {"row-selected", "clicked"})
{
list_window.list.addCallback list_window.list.addCallback
( (
"row-selected", signal,
F_METHOD_CALLBACK (this, &FComboBox::cb_closeComboBox)
);
list_window.list.addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FComboBox::cb_closeComboBox) F_METHOD_CALLBACK (this, &FComboBox::cb_closeComboBox)
); );
} }
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FComboBox::draw() void FComboBox::draw()

View File

@ -1646,6 +1646,7 @@ void FWidget::onAccel (FAccelEvent*)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onResize (FResizeEvent* ev) void FWidget::onResize (FResizeEvent* ev)
{ {
// The terminal was resized
rootObject->resize(); rootObject->resize();
rootObject->redraw(); rootObject->redraw();
ev->accept(); ev->accept();
@ -1779,7 +1780,7 @@ inline void FWidget::insufficientSpaceAdjust()
adjust_wsize.y2_ref()--; adjust_wsize.y2_ref()--;
if ( getHeight() < size_hints.min_height ) if ( getHeight() < size_hints.min_height )
adjust_wsize.setWidth(size_hints.min_height); adjust_wsize.setHeight(size_hints.min_height);
if ( getHeight() == 0 ) if ( getHeight() == 0 )
adjust_wsize.setHeight(1); adjust_wsize.setHeight(1);