Skip to content

Commit 53890c2

Browse files
committed
Toolbar icons now are dynamically sized in terms of the font size. Toolbar should no longer overlap the tab bar on any DPI setting.
1 parent 24642d2 commit 53890c2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ngscopeclient/MainWindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ void MainWindow::Toolbar()
755755
//Toolbar should be at the top of the main window.
756756
//Update work area size so docking area doesn't include the toolbar rectangle
757757
auto viewport = ImGui::GetMainViewport();
758-
float toolbarHeight = m_toolbarIconSize + 8;
758+
float toolbarHeight = 2.5 * ImGui::GetFontSize();
759759
m_workPos = ImVec2(viewport->WorkPos.x, viewport->WorkPos.y + toolbarHeight);
760760
m_workSize = ImVec2(viewport->WorkSize.x, viewport->WorkSize.y - toolbarHeight);
761761
ImGui::SetNextWindowPos(viewport->WorkPos);
@@ -789,7 +789,6 @@ void MainWindow::Toolbar()
789789
ImGui::SetNextItemWidth(6 * toolbarHeight);
790790
if(ImGui::SliderFloat("Intensity", &m_traceAlpha, 0, 0.75, "", ImGuiSliderFlags_Logarithmic))
791791
SetNeedRender();
792-
ImGui::SetCursorPosY(y);
793792

794793
ImGui::End();
795794
}
@@ -977,7 +976,8 @@ void MainWindow::TriggerStopDropdown(float buttonsize)
977976

978977
void MainWindow::ToolbarButtons()
979978
{
980-
ImVec2 buttonsize(m_toolbarIconSize, m_toolbarIconSize);
979+
float sz = 2 * ImGui::GetFontSize();
980+
ImVec2 buttonsize(sz, sz);
981981

982982
bool multigroup = (m_session.GetTriggerGroups().size() > 1);
983983

src/ngscopeclient/MainWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *

src/ngscopeclient/MainWindow_Icons.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *

0 commit comments

Comments
 (0)