require a bit bigger screen so all possible dialogs will fit
This commit is contained in:
@@ -84,10 +84,10 @@ void Action::ValidateScreenSize()
|
||||
{
|
||||
using Global::MainHeight;
|
||||
|
||||
if (COLS < 20 || MainHeight < 3)
|
||||
if (COLS < 30 || MainHeight < 5)
|
||||
{
|
||||
NC::destroyScreen();
|
||||
std::cout << "Screen is too small!\n";
|
||||
std::cout << "Screen is too small to handle ncmpcpp correctly\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,14 +137,9 @@ void Playlist::resize()
|
||||
if (w == SortDialog) // if sorting window is active, playlist needs refreshing
|
||||
Items->display();
|
||||
|
||||
SortDialogHeight = std::min(int(MainHeight), 17);
|
||||
if (Items->getWidth() >= SortDialogWidth && MainHeight >= 5)
|
||||
{
|
||||
SortDialogHeight = std::min(size_t(17), MainHeight);
|
||||
SortDialog->resize(SortDialogWidth, SortDialogHeight);
|
||||
SortDialog->moveTo(x_offset+(width-SortDialogWidth)/2, (MainHeight-SortDialogHeight)/2+MainStartY);
|
||||
}
|
||||
else // if screen is too low to display sorting window, fall back to items list
|
||||
w = Items;
|
||||
|
||||
hasToBeResized = 0;
|
||||
}
|
||||
@@ -390,13 +385,8 @@ void Playlist::Sort()
|
||||
{
|
||||
if (isFiltered())
|
||||
return;
|
||||
if (Items->getWidth() < SortDialogWidth || MainHeight < 5)
|
||||
Statusbar::msg("Screen is too small to display dialog window");
|
||||
else
|
||||
{
|
||||
SortDialog->reset();
|
||||
w = SortDialog;
|
||||
}
|
||||
}
|
||||
|
||||
void Playlist::Reverse()
|
||||
|
||||
@@ -76,12 +76,6 @@ void SelectedItemsAdder::switchTo()
|
||||
if (!hs || !hs->allowsSelection())
|
||||
return;
|
||||
|
||||
if (MainHeight < 5)
|
||||
{
|
||||
Statusbar::msg("Screen is too small to display this window");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isInitialized)
|
||||
init();
|
||||
|
||||
|
||||
@@ -52,11 +52,6 @@ void ServerInfo::switchTo()
|
||||
myOldScreen->switchTo();
|
||||
return;
|
||||
}
|
||||
if (MainHeight < 5)
|
||||
{
|
||||
Statusbar::msg("Screen is too small to display this window");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isInitialized)
|
||||
init();
|
||||
|
||||
@@ -155,7 +155,7 @@ void TagEditor::SetDimensions(size_t x_offset, size_t width)
|
||||
RightColumnStartX = MiddleColumnStartX+MiddleColumnWidth+1;
|
||||
|
||||
FParserDialogWidth = std::min(30, COLS);
|
||||
FParserDialogHeight = std::min(size_t(6), MainHeight);
|
||||
FParserDialogHeight = std::min(size_t(5), MainHeight);
|
||||
FParserWidth = width*0.9;
|
||||
FParserHeight = std::min(size_t(LINES*0.8), MainHeight);
|
||||
FParserWidthOne = FParserWidth/2;
|
||||
@@ -185,9 +185,6 @@ void TagEditor::resize()
|
||||
FParserLegend->moveTo(x_offset+(width-FParserWidth)/2+FParserWidthOne, (MainHeight-FParserHeight)/2+MainStartY);
|
||||
FParserPreview->moveTo(x_offset+(width-FParserWidth)/2+FParserWidthOne, (MainHeight-FParserHeight)/2+MainStartY);
|
||||
|
||||
if (MainHeight < 5 && (w == FParserDialog || w == FParser || w == FParserHelper)) // screen too low
|
||||
w = TagTypes; // fall back to main columns
|
||||
|
||||
hasToBeResized = 0;
|
||||
}
|
||||
|
||||
@@ -534,11 +531,6 @@ void TagEditor::enterPressed()
|
||||
{
|
||||
if (w == TagTypes)
|
||||
{
|
||||
if (size_t(COLS) < FParserDialogWidth || MainHeight < FParserDialogHeight)
|
||||
{
|
||||
Statusbar::msg("Screen is too small to display additional windows");
|
||||
return;
|
||||
}
|
||||
FParserDialog->reset();
|
||||
w = FParserDialog;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user