Fixed some minor bugs

This commit is contained in:
Markus Gans 2020-06-11 23:00:18 +02:00
parent ccb7eeb3c6
commit 9845a022a3
7 changed files with 13 additions and 13 deletions

View File

@ -54,7 +54,7 @@ class Dialog final : public finalcut::FDialog
Dialog::Dialog (FWidget* parent) Dialog::Dialog (FWidget* parent)
: finalcut::FDialog{parent} : finalcut::FDialog{parent}
{ {
setText ("Dialog"); FDialog::setText ("Dialog");
finalcut::FDialog::setGeometry (FPoint{26, 5}, FSize{28, 10}); finalcut::FDialog::setGeometry (FPoint{26, 5}, FSize{28, 10});
seconds.setGeometry (FPoint{10, 2}, FSize{10, 1}); seconds.setGeometry (FPoint{10, 2}, FSize{10, 1});
seconds.setLabelText ("Seconds"); seconds.setLabelText ("Seconds");
@ -87,14 +87,14 @@ Dialog::Dialog (FWidget* parent)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Dialog::adjustSize() void Dialog::adjustSize()
{ {
finalcut::FDialog::adjustSize();
int X = int((getDesktopWidth() - getWidth()) / 2); int X = int((getDesktopWidth() - getWidth()) / 2);
const int Y = 5; const int Y = 5;
if ( X < 1 ) if ( X < 1 )
X = 1; X = 1;
setPos ({X, Y}, false); setPos (FPoint{X, Y}, false);
finalcut::FDialog::adjustSize();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -111,7 +111,7 @@ void Dialog::cb_start (const finalcut::FWidget*, const FDataPtr)
return; return;
busy_indicator.start(); busy_indicator.start();
addTimer(seconds.getValue() * 1000); addTimer(int(seconds.getValue() * 1000));
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -198,7 +198,7 @@ std::size_t FProgressbar::drawProgressIndicator()
if ( len >= bar_length ) if ( len >= bar_length )
return len; return len;
if ( round(length) > len || FTerm::getMaxColor() < 16 ) if ( std::size_t(round(length)) > len || FTerm::getMaxColor() < 16 )
{ {
if ( FTerm::isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);

View File

@ -732,9 +732,9 @@ void FScrollbar::jumpToClickPos (int x, int y)
if ( bar_orientation == fc::vertical ) if ( bar_orientation == fc::vertical )
{ {
if ( y >1 && y < int(getHeight()) ) if ( y > 1 && y < int(getHeight()) )
{ {
new_val = int( round ( double(max - min) * (y - 2.0 - (slider_length/2)) new_val = int( round ( double(max - min) * (y - 2.0 - double(slider_length/2))
/ double(bar_length - slider_length) ) ); / double(bar_length - slider_length) ) );
} }
else else
@ -746,7 +746,7 @@ void FScrollbar::jumpToClickPos (int x, int y)
if ( x > 1 + nf && x < int(getWidth()) - nf ) if ( x > 1 + nf && x < int(getWidth()) - nf )
{ {
new_val = int( round ( double(max - min) * (x - 2.0 - nf - (slider_length/2)) new_val = int( round ( double(max - min) * (x - 2.0 - nf - double(slider_length/2))
/ double(bar_length - slider_length) ) ); / double(bar_length - slider_length) ) );
} }
else else

View File

@ -428,7 +428,7 @@ void FSpinBox::forceFocus()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FSpinBox::cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr) void FSpinBox::cb_inputFieldActivate (const finalcut::FWidget*, const FDataPtr)
{ {
processActivate(); processActivate();
} }

View File

@ -85,7 +85,7 @@ class FBusyIndicator : public FToolTip
const FString getClassName() const override; const FString getClassName() const override;
// Inquiries // Inquiries
bool isRunning(); bool isRunning() const;
// Methods // Methods
void start(); void start();
@ -116,7 +116,7 @@ inline const FString FBusyIndicator::getClassName() const
{ return "FBusyIndicator"; } { return "FBusyIndicator"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FBusyIndicator::isRunning() inline bool FBusyIndicator::isRunning() const
{ {
return running; return running;
} }

View File

@ -140,7 +140,7 @@ class FSpinBox : public FWidget
void forceFocus(); void forceFocus();
// Callback methods // Callback methods
void cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr); void cb_inputFieldActivate (const finalcut::FWidget*, const FDataPtr);
void cb_inputFieldChange (finalcut::FWidget*, const FDataPtr); void cb_inputFieldChange (finalcut::FWidget*, const FDataPtr);
// Data members // Data members

View File

@ -97,7 +97,7 @@ class FStartOptions final
uInt16 : 15; // padding bits uInt16 : 15; // padding bits
fc::encoding encoding{fc::UNKNOWN}; fc::encoding encoding{fc::UNKNOWN};
std::ofstream logfile_stream; std::ofstream logfile_stream{};
static FStartOptions* start_options; static FStartOptions* start_options;
}; };