From 9845a022a3565a00a481b54f66a1c91f8791e04d Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Thu, 11 Jun 2020 23:00:18 +0200 Subject: [PATCH] Fixed some minor bugs --- examples/busy.cpp | 8 ++++---- src/fprogressbar.cpp | 2 +- src/fscrollbar.cpp | 6 +++--- src/fspinbox.cpp | 2 +- src/include/final/fbusyindicator.h | 4 ++-- src/include/final/fspinbox.h | 2 +- src/include/final/fstartoptions.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/busy.cpp b/examples/busy.cpp index c564a3c4..2bc2716b 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -54,7 +54,7 @@ class Dialog final : public finalcut::FDialog Dialog::Dialog (FWidget* parent) : finalcut::FDialog{parent} { - setText ("Dialog"); + FDialog::setText ("Dialog"); finalcut::FDialog::setGeometry (FPoint{26, 5}, FSize{28, 10}); seconds.setGeometry (FPoint{10, 2}, FSize{10, 1}); seconds.setLabelText ("Seconds"); @@ -87,14 +87,14 @@ Dialog::Dialog (FWidget* parent) //---------------------------------------------------------------------- void Dialog::adjustSize() { + finalcut::FDialog::adjustSize(); int X = int((getDesktopWidth() - getWidth()) / 2); const int Y = 5; if ( X < 1 ) X = 1; - setPos ({X, Y}, false); - finalcut::FDialog::adjustSize(); + setPos (FPoint{X, Y}, false); } //---------------------------------------------------------------------- @@ -111,7 +111,7 @@ void Dialog::cb_start (const finalcut::FWidget*, const FDataPtr) return; busy_indicator.start(); - addTimer(seconds.getValue() * 1000); + addTimer(int(seconds.getValue() * 1000)); } //---------------------------------------------------------------------- diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index b006546a..829b8af9 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -198,7 +198,7 @@ std::size_t FProgressbar::drawProgressIndicator() if ( len >= bar_length ) return len; - if ( round(length) > len || FTerm::getMaxColor() < 16 ) + if ( std::size_t(round(length)) > len || FTerm::getMaxColor() < 16 ) { if ( FTerm::isMonochron() ) setReverse(false); diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 257aeca9..9dd0491f 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -732,9 +732,9 @@ void FScrollbar::jumpToClickPos (int x, int y) 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) ) ); } else @@ -746,7 +746,7 @@ void FScrollbar::jumpToClickPos (int x, int y) 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) ) ); } else diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index a1636757..c477b40d 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -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(); } diff --git a/src/include/final/fbusyindicator.h b/src/include/final/fbusyindicator.h index 42cd9359..9fb39bf8 100644 --- a/src/include/final/fbusyindicator.h +++ b/src/include/final/fbusyindicator.h @@ -85,7 +85,7 @@ class FBusyIndicator : public FToolTip const FString getClassName() const override; // Inquiries - bool isRunning(); + bool isRunning() const; // Methods void start(); @@ -116,7 +116,7 @@ inline const FString FBusyIndicator::getClassName() const { return "FBusyIndicator"; } //---------------------------------------------------------------------- -inline bool FBusyIndicator::isRunning() +inline bool FBusyIndicator::isRunning() const { return running; } diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 65a67858..0b9f5b36 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -140,7 +140,7 @@ class FSpinBox : public FWidget void forceFocus(); // Callback methods - void cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr); + void cb_inputFieldActivate (const finalcut::FWidget*, const FDataPtr); void cb_inputFieldChange (finalcut::FWidget*, const FDataPtr); // Data members diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index 3c164130..6a0d1ad6 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -97,7 +97,7 @@ class FStartOptions final uInt16 : 15; // padding bits fc::encoding encoding{fc::UNKNOWN}; - std::ofstream logfile_stream; + std::ofstream logfile_stream{}; static FStartOptions* start_options; };