Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/fe6b92513f5c715a52ac92be91837bc152e86b4a?style=unified&whitespace=ignore-eol
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
33 additions and
2 deletions
src/board/UBBoardView.cpp
src/domain/UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.h
@ -1335,6 +1335,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
textItem - > setTextInteractionFlags ( Qt : : TextEditorInteraction ) ;
textItem - > setSelected ( true ) ;
textItem - > setTextWidth ( 0 ) ;
textItem - > setFocus ( ) ;
}
}
@ -306,8 +306,12 @@ QPainterPath UBGraphicsTextItem::shape() const
void UBGraphicsTextItem : : setTextWidth ( qreal width )
{
qreal strictMin = 155 ; // the size of the font customization panel
qreal newWidth = qMax ( strictMin , width ) ;
qreal titleBarWidth = 0 ;
UBGraphicsTextItemDelegate * del = dynamic_cast < UBGraphicsTextItemDelegate * > ( Delegate ( ) ) ;
if ( del )
titleBarWidth = del - > titleBarWidth ( ) ;
qreal newWidth = qMax ( titleBarWidth , width ) ;
QGraphicsTextItem : : setTextWidth ( newWidth ) ;
}
@ -204,6 +204,31 @@ void UBGraphicsTextItemDelegate::createControls()
}
/**
* @ brief Calculate the width of the toolbar containing the text item - related buttons
* @ return The space between the left - most and right - most buttons in pixels
*/
qreal UBGraphicsTextItemDelegate : : titleBarWidth ( )
{
if ( ! mFontButton )
return 0 ;
// refresh the frame and buttons' positions
positionHandles ( ) ;
qreal titleBarWidth ( 0 ) ;
qreal frameLeftCoordinate = mFontButton - > pos ( ) . x ( ) ;
qreal frameRightCoordinate = frameLeftCoordinate ;
foreach ( DelegateButton * button , mButtons ) {
if ( button - > getSection ( ) = = Qt : : TitleBarArea ) {
frameLeftCoordinate = qMin ( button - > pos ( ) . x ( ) , frameLeftCoordinate ) ;
frameRightCoordinate = qMax ( button - > pos ( ) . x ( ) + button - > boundingRect ( ) . width ( ) , frameRightCoordinate ) ;
}
}
return frameRightCoordinate - frameLeftCoordinate ;
}
void UBGraphicsTextItemDelegate : : freeButtons ( )
{
@ -114,6 +114,7 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
void scaleTextSize ( qreal multiplyer ) ;
virtual QVariant itemChange ( QGraphicsItem : : GraphicsItemChange change , const QVariant & value ) ;
virtual void createControls ( ) ;
qreal titleBarWidth ( ) ;
public slots :
void contentsChanged ( ) ;