Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.h
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
306 | //* create xcb atom | 306 | //* create xcb atom | ||
307 | xcb_atom_t createAtom( const QString& ) const; | 307 | xcb_atom_t createAtom( const QString& ) const; | ||
308 | 308 | | |||
309 | #endif | 309 | #endif | ||
310 | 310 | | |||
311 | //@} | 311 | //@} | ||
312 | 312 | | |||
313 | //* frame radius | 313 | //* frame radius | ||
314 | qreal frameRadius( qreal bias = 0 ) const | 314 | constexpr qreal frameRadius( const int penWidth = PenWidth::NoPen, const qreal bias = 0 ) const | ||
315 | { return qMax( qreal( Metrics::Frame_FrameRadius ) - 0.5 + bias, 0.0 ); } | 315 | { return qMax( Metrics::Frame_FrameRadius - (0.5 * penWidth) + bias, 0.0 ); } | ||
316 | | ||||
317 | //* frame radius with new pen width | ||||
318 | constexpr qreal newFrameRadius ( const qreal oldRadius, const int penWidth ) const | ||||
hpereiradacosta: Would need a new function name than "newFrameRadius", that makes it clear when this should be… | |||||
319 | { return qMax( oldRadius - (0.5 * penWidth), 0.0 ); } | ||||
316 | 320 | | |||
317 | //* return a QRectF with the appropriate size for a rectangle with a pen stroke | 321 | //* return a QRectF with the appropriate size for a rectangle with a pen stroke | ||
318 | QRectF strokedRect( const QRectF &rect, const int penWidth = PenWidth::Frame ) const; | 322 | QRectF strokedRect( const QRectF &rect, const int penWidth = PenWidth::Frame ) const; | ||
319 | 323 | | |||
320 | //* return a QRectF with the appropriate size for a rectangle with a pen stroke | 324 | //* return a QRectF with the appropriate size for a rectangle with a pen stroke | ||
321 | QRectF strokedRect( const QRect &rect, const int penWidth = PenWidth::Frame ) const; | 325 | QRectF strokedRect( const QRect &rect, const int penWidth = PenWidth::Frame ) const; | ||
322 | 326 | | |||
323 | protected: | 327 | protected: | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Would need a new function name than "newFrameRadius", that makes it clear when this should be used on not the other.