diff --git a/headers/private/print/libprint/AddPrinterDlg.h b/headers/private/print/libprint/AddPrinterDlg.h index bfb3e7b144..cbbe62c09f 100644 --- a/headers/private/print/libprint/AddPrinterDlg.h +++ b/headers/private/print/libprint/AddPrinterDlg.h @@ -31,6 +31,7 @@ public: AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap); ~AddPrinterView(); virtual void AttachedToWindow(); + void FrameResized(float w, float h); void MessageReceived(BMessage *msg); void Save(); diff --git a/src/add-ons/print/drivers/shared/libprint/AddPrinterDlg.cpp b/src/add-ons/print/drivers/shared/libprint/AddPrinterDlg.cpp index 83934c7353..a09e7785e9 100644 --- a/src/add-ons/print/drivers/shared/libprint/AddPrinterDlg.cpp +++ b/src/add-ons/print/drivers/shared/libprint/AddPrinterDlg.cpp @@ -106,7 +106,7 @@ ProtocolClassItem::getDescription() AddPrinterView::AddPrinterView(BRect frame, PrinterData *printer_data, const PrinterCap *printer_cap) - : BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), fPrinterData(printer_data), fPrinterCap(printer_cap) + : BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS), fPrinterData(printer_data), fPrinterCap(printer_cap) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); } @@ -184,6 +184,16 @@ AddPrinterView::AttachedToWindow() MessageReceived(&updateDescription); } +void +AddPrinterView::FrameResized(float w, float h) +{ + BView::FrameResized(w, h); + // update text rectangle + BRect rect(fDescription->TextRect()); + rect.right = rect.left + fDescription->Frame().Width(); + fDescription->SetTextRect(rect); +} + ProtocolClassItem * AddPrinterView::CurrentSelection() {