From 608d08d252697057ec601ed25f05416d15a91d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 21 Nov 2017 16:30:15 +0100 Subject: [PATCH] UI - Window sizes changed --- odbg.cc | 2 +- profiling.cc | 6 ++---- shaders.cc | 4 ++-- sync.cc | 2 +- syncview.cc | 16 ++-------------- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/odbg.cc b/odbg.cc index abd4586..a3282a5 100644 --- a/odbg.cc +++ b/odbg.cc @@ -44,7 +44,7 @@ void T_OutputDebugger::makeUI( ) using namespace ImGui; auto const& dspSize( GetIO( ).DisplaySize ); - SetNextWindowSize( ImVec2( 300 , dspSize.y - 170 ) , ImGuiSetCond_Appearing ); + SetNextWindowSize( ImVec2( dspSize.x * .25f , dspSize.y * .66f - 20 ) , ImGuiSetCond_Appearing ); SetNextWindowPos( ImVec2( 0 , 20 ) , ImGuiSetCond_Appearing ); Begin( "Output debugger" , &enabled_ , ImGuiWindowFlags_NoCollapse ); diff --git a/profiling.cc b/profiling.cc index 8d51f2f..8103acf 100644 --- a/profiling.cc +++ b/profiling.cc @@ -118,10 +118,8 @@ void T_Profiler::makeUI( ) } auto const& dspSize( ImGui::GetIO( ).DisplaySize ); - ImGui::SetNextWindowSize( ImVec2( dspSize.x , 150 ) , - ImGuiSetCond_Appearing ); - ImGui::SetNextWindowPos( ImVec2( 0 , dspSize.y - 150 ) , - ImGuiSetCond_Appearing ); + ImGui::SetNextWindowSize( ImVec2( dspSize.x , dspSize.y * .34f ) , ImGuiSetCond_Appearing ); + ImGui::SetNextWindowPos( ImVec2( 0 , dspSize.y * .66f ) , ImGuiSetCond_Appearing ); ImGui::Begin( "Profiler" , &uiEnabled_ , ImGuiWindowFlags_NoCollapse ); ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true ); diff --git a/shaders.cc b/shaders.cc index 8df3529..d553cc3 100644 --- a/shaders.cc +++ b/shaders.cc @@ -1113,8 +1113,8 @@ void T_ShaderManager::makeUI( ) using namespace ImGui; auto const& dspSize( GetIO( ).DisplaySize ); - SetNextWindowSize( ImVec2( dspSize.x , 150 ) , ImGuiSetCond_Appearing ); - SetNextWindowPos( ImVec2( 0 , dspSize.y - 150 ) , ImGuiSetCond_Appearing ); + SetNextWindowSize( ImVec2( dspSize.x , dspSize.y * .34f ) , ImGuiSetCond_Appearing ); + SetNextWindowPos( ImVec2( 0 , dspSize.y * .66f ) , ImGuiSetCond_Appearing ); Begin( "Shaders" , &uiEnabled_ , ImGuiWindowFlags_NoCollapse ); const auto n( std::count_if( programs_.begin( ) , programs_.end( ) , diff --git a/sync.cc b/sync.cc index 91b2fa5..119061a 100644 --- a/sync.cc +++ b/sync.cc @@ -727,7 +727,7 @@ void T_SyncManager::makeOverridesWindow( ) using namespace ImGui; auto const& dspSize( GetIO( ).DisplaySize ); - SetNextWindowSize( ImVec2( 300 , dspSize.y - 170 ) , ImGuiSetCond_Appearing ); + SetNextWindowSize( ImVec2( dspSize.x * .25f , dspSize.y * .66f - 20 ) , ImGuiSetCond_Appearing ); SetNextWindowPos( ImVec2( 0 , 20 ) , ImGuiSetCond_Appearing ); Begin( "Input overrides" , &ovWindow_ , ImGuiWindowFlags_NoCollapse ); diff --git a/syncview.cc b/syncview.cc index 17a7aab..ae866a6 100644 --- a/syncview.cc +++ b/syncview.cc @@ -59,8 +59,8 @@ bool T_SyncViewImpl_::display( ) noexcept auto& sync( Globals::Sync( ) ); // Window set-up - SetNextWindowSize( ImVec2( dspSize.x , 150 ) , ImGuiSetCond_Appearing ); - SetNextWindowPos( ImVec2( 0 , dspSize.y - 150 ) , ImGuiSetCond_Appearing ); + SetNextWindowSize( ImVec2( dspSize.x , dspSize.y * .34f ) , ImGuiSetCond_Appearing ); + SetNextWindowPos( ImVec2( 0 , dspSize.y * .66f ) , ImGuiSetCond_Appearing ); bool displayed{ true }; Begin( "Sequencer" , &displayed , ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollWithMouse ); @@ -92,18 +92,6 @@ bool T_SyncViewImpl_::display( ) noexcept } PopID( ); - const float d( sync.duration( ) ); - float tm( sync.time( ) ); - SameLine( ); - PushID( "sequencer" ); - PushItemWidth( -1 ); - if ( SliderFloat( "" , &tm , 0 , d , "%.1fs" ) ) { - sync.setTime( tm ); - sync.playing( ) = sync.playing( ) && !sync.finished( ); - } - PopItemWidth( ); - PopID( ); - PushItemWidth( -1 ); sequencerWidget( ); PopItemWidth( );