* 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
This commit is contained in:
Axel Dörfler 2009-11-06 15:47:35 +00:00
parent 3a1b098bc8
commit df989eb2bb
2 changed files with 17 additions and 6 deletions

View File

@ -9,6 +9,8 @@
#include <new> #include <new>
#include <ControlLook.h>
#include "table/TableColumns.h" #include "table/TableColumns.h"
#include "Architecture.h" #include "Architecture.h"
@ -237,9 +239,13 @@ RegistersView::_Init()
AddChild(fRegisterTable->ToView()); AddChild(fRegisterTable->ToView());
// columns // 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)); 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)); B_TRUNCATE_END, B_ALIGN_RIGHT));
fRegisterTableModel = new RegisterTableModel(fArchitecture); fRegisterTableModel = new RegisterTableModel(fArchitecture);

View File

@ -10,6 +10,8 @@
#include <new> #include <new>
#include <ControlLook.h>
#include "table/TableColumns.h" #include "table/TableColumns.h"
#include "FunctionInstance.h" #include "FunctionInstance.h"
@ -214,11 +216,14 @@ StackTraceView::_Init()
AddChild(fFramesTable->ToView()); AddChild(fFramesTable->ToView());
fFramesTable->SetSortingEnabled(false); fFramesTable->SetSortingEnabled(false);
float addressWidth = be_plain_font->StringWidth("0x00000000")
+ be_control_look->DefaultLabelSpacing() * 2 + 5;
// columns // columns
fFramesTable->AddColumn(new TargetAddressTableColumn(0, "Frame", 80, 40, fFramesTable->AddColumn(new TargetAddressTableColumn(0, "Frame",
1000, B_TRUNCATE_END, B_ALIGN_RIGHT)); addressWidth, 40, 1000, B_TRUNCATE_END, B_ALIGN_RIGHT));
fFramesTable->AddColumn(new TargetAddressTableColumn(1, "IP", 80, 40, 1000, fFramesTable->AddColumn(new TargetAddressTableColumn(1, "IP", addressWidth,
B_TRUNCATE_END, B_ALIGN_RIGHT)); 40, 1000, B_TRUNCATE_END, B_ALIGN_RIGHT));
fFramesTable->AddColumn(new StringTableColumn(2, "Function", 300, 100, 1000, fFramesTable->AddColumn(new StringTableColumn(2, "Function", 300, 100, 1000,
B_TRUNCATE_END, B_ALIGN_LEFT)); B_TRUNCATE_END, B_ALIGN_LEFT));