feat: persist floating panel layouts and wrap the compact transport
This commit is contained in:
parent
836cdedc6b
commit
73e8bf09dc
9 changed files with 149 additions and 13 deletions
|
|
@ -1237,6 +1237,35 @@ int main(int argc, char **argv)
|
|||
close_result=XTC_OK; window.do_callback();
|
||||
CHECK(!window.shown() && !window.transport_window()->shown() && !window.mixer_window()->shown());
|
||||
}
|
||||
reset();
|
||||
{
|
||||
std::string path="/tmp/xtc-panel-layout-"+std::to_string(getpid())+".conf";
|
||||
{
|
||||
MainWindow window(false,path.c_str());window.show();
|
||||
window.detach_transport(true);window.detach_mixer(true);
|
||||
window.transport_window()->resize(40,40,400,400);window.mixer_window()->resize(80,80,700,460);pump();
|
||||
auto *group=dynamic_cast<Fl_Group *>(find(window.transport_window(),"Play")->parent());CHECK(group);
|
||||
for(int i=0;i<group->children();++i) {
|
||||
auto *widget=group->child(i);CHECK(widget->x()>=0 && widget->x()+widget->w()<=400);
|
||||
CHECK(widget->y()+widget->h()<=window.transport_window()->h());
|
||||
}
|
||||
Fl::add_timeout(.05,[](void *) {auto *d=Fl::first_window();press(find(d,"Apply"));press(find(d,"Close"));});
|
||||
window.show_preferences();xtc_settings saved{};CHECK(xtc_settings_load(&saved,path.c_str())==XTC_OK);
|
||||
CHECK(saved.transport_detached && saved.mixer_detached && saved.transport_width==400 && saved.mixer_width==700);
|
||||
saved.transport_x=30000;saved.transport_y=-30000;CHECK(xtc_settings_save(&saved,path.c_str())==XTC_OK);
|
||||
window.do_callback();
|
||||
}
|
||||
{
|
||||
MainWindow window(false,path.c_str());window.show();pump();
|
||||
CHECK(window.transport_window() && window.transport_window()->shown());
|
||||
CHECK(window.mixer_window() && window.mixer_window()->shown());
|
||||
int sx,sy,sw,sh;Fl::screen_work_area(sx,sy,sw,sh,0);
|
||||
CHECK(window.transport_window()->x()>=sx && window.transport_window()->x()+window.transport_window()->w()<=sx+sw);
|
||||
CHECK(window.transport_window()->y()>=sy && window.transport_window()->y()+window.transport_window()->h()<=sy+sh);
|
||||
window.detach_transport(false);window.detach_mixer(false);window.do_callback();
|
||||
}
|
||||
unlink(path.c_str());
|
||||
}
|
||||
if (failures != 0) return 1;
|
||||
std::printf("GUI controls/errors/views/timers/cleanup passed: %u opens, %u closes.\n", opens, closes);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue