From df989eb2bbe534fd8874261f670715119e673ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 6 Nov 2009 15:47:35 +0000 Subject: [PATCH] * Improved default column sizes. Maybe the table view class should be able to do so automatically? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33920 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../gui/team_window/RegistersView.cpp | 10 ++++++++-- .../gui/team_window/StackTraceView.cpp | 13 +++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/RegistersView.cpp b/src/apps/debugger/user_interface/gui/team_window/RegistersView.cpp index 9439faf16e..b68e37ccaa 100644 --- a/src/apps/debugger/user_interface/gui/team_window/RegistersView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/RegistersView.cpp @@ -9,6 +9,8 @@ #include +#include + #include "table/TableColumns.h" #include "Architecture.h" @@ -237,9 +239,13 @@ RegistersView::_Init() AddChild(fRegisterTable->ToView()); // columns - fRegisterTable->AddColumn(new StringTableColumn(0, "Register", 80, 40, 1000, + fRegisterTable->AddColumn(new StringTableColumn(0, "Register", + be_plain_font->StringWidth("Register") + + be_control_look->DefaultLabelSpacing() * 2 + 5, 40, 1000, B_TRUNCATE_END, B_ALIGN_LEFT)); - fRegisterTable->AddColumn(new RegisterValueColumn(1, "Value", 80, 40, 1000, + fRegisterTable->AddColumn(new RegisterValueColumn(1, "Value", + be_plain_font->StringWidth("0x00000000") + + be_control_look->DefaultLabelSpacing() * 2 + 5, 40, 1000, B_TRUNCATE_END, B_ALIGN_RIGHT)); fRegisterTableModel = new RegisterTableModel(fArchitecture); diff --git a/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp b/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp index 518477c225..3489e5d6dc 100644 --- a/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/StackTraceView.cpp @@ -10,6 +10,8 @@ #include +#include + #include "table/TableColumns.h" #include "FunctionInstance.h" @@ -214,11 +216,14 @@ StackTraceView::_Init() AddChild(fFramesTable->ToView()); fFramesTable->SetSortingEnabled(false); + float addressWidth = be_plain_font->StringWidth("0x00000000") + + be_control_look->DefaultLabelSpacing() * 2 + 5; + // columns - fFramesTable->AddColumn(new TargetAddressTableColumn(0, "Frame", 80, 40, - 1000, B_TRUNCATE_END, B_ALIGN_RIGHT)); - fFramesTable->AddColumn(new TargetAddressTableColumn(1, "IP", 80, 40, 1000, - B_TRUNCATE_END, B_ALIGN_RIGHT)); + fFramesTable->AddColumn(new TargetAddressTableColumn(0, "Frame", + addressWidth, 40, 1000, B_TRUNCATE_END, B_ALIGN_RIGHT)); + fFramesTable->AddColumn(new TargetAddressTableColumn(1, "IP", addressWidth, + 40, 1000, B_TRUNCATE_END, B_ALIGN_RIGHT)); fFramesTable->AddColumn(new StringTableColumn(2, "Function", 300, 100, 1000, B_TRUNCATE_END, B_ALIGN_LEFT));