# HG changeset patch # User Teemu Piippo # Date 1409507696 -10800 # Node ID a860edb4210b4d73b5ccb7543db983cd981c15ac # Parent 9e9e71ebfbe7cbe330ccfde2ad3560071fb4527b - display a label next to the spinbox showing the fraction diff -r 9e9e71ebfbe7 -r a860edb4210b src/mainWindow.cc --- a/src/mainWindow.cc Sun Aug 31 20:42:20 2014 +0300 +++ b/src/mainWindow.cc Sun Aug 31 20:54:56 2014 +0300 @@ -122,6 +122,9 @@ setMinimumSize (300, 200); connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup())); connect (ui->ringToolHiRes, SIGNAL (clicked (bool)), this, SLOT (ringToolHiResClicked (bool))); + connect (ui->ringToolSegments, SIGNAL (valueChanged (int)), + this, SLOT (circleToolSegmentsChanged())); + circleToolSegmentsChanged(); // invoke it manually for initial label text } MainWindow::~MainWindow() @@ -1086,6 +1089,15 @@ } } +// ============================================================================= +// +void MainWindow::circleToolSegmentsChanged() +{ + int numerator (ui->ringToolSegments->value()); + int denominator (ui->ringToolHiRes->isChecked() ? HighResolution : LowResolution); + Simplify (numerator, denominator); + ui->ringToolSegmentsLabel->setText (format ("%1 / %2", numerator, denominator)); +} // ============================================================================= // diff -r 9e9e71ebfbe7 -r a860edb4210b src/mainWindow.h --- a/src/mainWindow.h Sun Aug 31 20:42:20 2014 +0300 +++ b/src/mainWindow.h Sun Aug 31 20:54:56 2014 +0300 @@ -180,6 +180,7 @@ void changeCurrentFile(); void closeTab (int tabindex); void ringToolHiResClicked (bool clicked); + void circleToolSegmentsChanged(); void slot_action(); void slot_actionNew(); void slot_actionNewFile(); diff -r 9e9e71ebfbe7 -r a860edb4210b ui/ldforge.ui --- a/ui/ldforge.ui Sun Aug 31 20:42:20 2014 +0300 +++ b/ui/ldforge.ui Sun Aug 31 20:54:56 2014 +0300 @@ -48,7 +48,7 @@ 0 0 237 - 414 + 434 @@ -76,17 +76,17 @@ 0 0 237 - 414 + 434 - Edit Mode Options + Tool Options - Ring Options + Circle Tool Options @@ -106,20 +106,31 @@ - - - true - - - 1 - - - 16 - - - 16 - - + + + + + true + + + 1 + + + 16 + + + 16 + + + + + + + a / b + + + + @@ -183,7 +194,7 @@ 0 0 1010 - 26 + 22