Skip to content

Commit

Permalink
Solve drag'n'drop conundrum with modal windows
Browse files Browse the repository at this point in the history
Being modal windows, you're unable to browse the file
system to drag'n'drop files into the ignore list. Worse,
the file dialog that opens when clicking the Add... button
isn't reachable either.

The work around now is that while the Setup window is open,
the 'modal' main window becomes 'normal'.

Thanks Diver for reporting this bug. Apparently I haven't used
the file dialog or tried to d'n'd files in a long time. I usually
add to-be-ignored files via the context menu of the main window...
  • Loading branch information
Humdinger committed May 26, 2019
1 parent e4d2ffb commit 40ec161
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
14 changes: 12 additions & 2 deletions QuickLaunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ QLApp::MessageReceived(BMessage* message)
switch (message->what) {
case SETUP_BUTTON:
{
if (fSetupWindow->IsHidden())
if (fSetupWindow->IsHidden()) {
SetWindowsFeel(B_NORMAL_WINDOW_FEEL);
fSetupWindow->Show();
else
} else
fSetupWindow->Hide();
break;
}
Expand Down Expand Up @@ -298,6 +299,15 @@ QLApp::ReadyToRun()
}


void
QLApp::SetWindowsFeel(window_feel feel)
{
fMainWindow->LockLooper();
fMainWindow->SetFeel(feel);
fMainWindow->UnlockLooper();
}


#pragma mark -- Private Methods --


Expand Down
1 change: 1 addition & 0 deletions QuickLaunch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class QLApp : public BApplication {
virtual void ReadyToRun();

QLSettings& Settings() { return fSettings; }
void SetWindowsFeel(window_feel feel);

SetupWindow* fSetupWindow;
MainWindow* fMainWindow;
Expand Down
7 changes: 6 additions & 1 deletion SetupWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ compare_items(const void* a, const void* b)
SetupWindow::SetupWindow(BRect frame)
:
BWindow(frame, B_TRANSLATE("Setup"), B_TITLED_WINDOW_LOOK,
B_MODAL_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_FRAME_EVENTS
B_NORMAL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_FRAME_EVENTS
| B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE)
{
QLSettings& settings = my_app->Settings();
Expand Down Expand Up @@ -158,6 +158,11 @@ bool
SetupWindow::QuitRequested()
{
this->Hide();

if (fOpenPanel->Window()->IsHidden() == false)
fOpenPanel->Hide();

my_app->SetWindowsFeel(B_MODAL_ALL_WINDOW_FEEL);
return false;
}

Expand Down

0 comments on commit 40ec161

Please sign in to comment.