Ticket #1701: colorControl9.diff
File colorControl9.diff, 2.2 KB (added by , 16 years ago) |
---|
-
src/kits/interface/ColorControl.cpp
64 64 BColorControl::_InitData(color_control_layout layout, float size, 65 65 bool useOffscreen, BMessage* archive) 66 66 { 67 fPaletteMode = false; 67 68 fColumns = layout; 68 69 fRows = 256 / fColumns; 69 70 fCellSize = ceil(max_c(kMinCellSize, size)); … … 156 157 void 157 158 BColorControl::_LayoutView() 158 159 { 159 fPaletteFrame.Set(2.0f, 2.0f, 160 float(fColumns) * fCellSize + 2.0, 161 float(fRows) * fCellSize + 2.0 - 1.0); 162 //1 pixel adjust so that the inner space 163 //has exactly rows*cellsize pixels in height 160 //TODO: set the layout after being attached to a window 161 //if (fPaletteMode){ 162 // fPaletteFrame.Set(2.0f, 2.0f, 163 // float(fColumns) * fCellSize + 2.0, 164 // float(fRows) * fCellSize + 2.0); 165 //} else { 166 fPaletteFrame.Set(2.0f, 2.0f, 167 float(fColumns) * fCellSize + 2.0, 168 float(fRows) * fCellSize + 2.0 - 1.0); 169 //1 pixel adjust so that the inner space 170 //has exactly rows*cellsize pixels in height 171 //} 164 172 165 173 BRect rect = fPaletteFrame.InsetByCopy(-2.0,-2.0); //bevel 166 174 … … 551 559 BRect 552 560 BColorControl::_RampFrame(uint8 rampIndex) const 553 561 { 554 float rampHeight = f PaletteFrame.Height() / 4;562 float rampHeight = float(fRows) * fCellSize / 4.0f; 555 563 556 return BRect( fPaletteFrame.left,564 return BRect( fPaletteFrame.left, 557 565 fPaletteFrame.top + float(rampIndex) * rampHeight, 558 566 fPaletteFrame.right, 559 567 fPaletteFrame.top + float(rampIndex + 1) * rampHeight); -
src/preferences/backgrounds/BackgroundsView.cpp
216 216 rightbox->AddChild(fIconLabelOutline); 217 217 218 218 rect.top += fIconLabelOutline->Bounds().Height() + 15; 219 fPicker = new BColorControl(BPoint(10, rect.top), B_CELLS_32x8, 5.0, "Picker",219 fPicker = new BColorControl(BPoint(10, rect.top), B_CELLS_32x8, 7.0, "Picker", 220 220 new BMessage(kMsgUpdateColor)); 221 221 rightbox->AddChild(fPicker); 222 222