MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -195,6 +195,8 @@ BTextControl::GetAlignment(alignment *label, alignment *text) const
|
||||
void
|
||||
BTextControl::SetDivider(float dividingLine)
|
||||
{
|
||||
dividingLine = floorf(dividingLine + 0.5);
|
||||
|
||||
float dx = fDivider - dividingLine;
|
||||
|
||||
fDivider = dividingLine;
|
||||
@@ -597,7 +599,7 @@ BTextControl::InitData(const char *label, const char *initial_text,
|
||||
SetFont(&font, flags);
|
||||
|
||||
if (label)
|
||||
fDivider = bounds.Width() / 2.0f;
|
||||
fDivider = floorf(bounds.Width() / 2.0f);
|
||||
|
||||
if (Flags() & B_NAVIGABLE) {
|
||||
fSkipSetFlags = true;
|
||||
@@ -608,8 +610,12 @@ BTextControl::InitData(const char *label, const char *initial_text,
|
||||
if (data)
|
||||
fText = static_cast<_BTextInput_ *>(FindView("_input_"));
|
||||
else {
|
||||
BRect frame(fDivider, bounds.top + 2.0f,
|
||||
bounds.right - 2.0f, bounds.bottom - 2.0f);
|
||||
BRect frame(fDivider, bounds.top,
|
||||
bounds.right, bounds.bottom);
|
||||
// we are stroking the frame arround the text view, which
|
||||
// is 2 pixels wide
|
||||
frame.InsetBy(2.0, 2.0);
|
||||
|
||||
BRect textRect(frame.OffsetToCopy(0.0f, 0.0f));
|
||||
textRect.InsetBy(2.0, 2.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user