fixed an issue where widget items would not have the correct OperationMode

preferencesAboutTextFull
Clément Fauconnier 4 years ago
parent 9b786030db
commit 07eb67ace9
  1. 3
      src/domain/UBGraphicsWidgetItem.cpp
  2. 7
      src/domain/UBGraphicsWidgetItemDelegate.cpp
  3. 7
      src/domain/UBGraphicsWidgetItemDelegate.h

@ -84,6 +84,9 @@ UBGraphicsWidgetItem::UBGraphicsWidgetItem(const QUrl &pWidgetUrl, QGraphicsItem
QGraphicsWebView::settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true); QGraphicsWebView::settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
QGraphicsWebView::settings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true); QGraphicsWebView::settings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
QGraphicsWebView::settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true); QGraphicsWebView::settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
#ifdef QT_DEBUG
QGraphicsWebView::settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
#endif
page()->setNetworkAccessManager(UBNetworkAccessManager::defaultAccessManager()); page()->setNetworkAccessManager(UBNetworkAccessManager::defaultAccessManager());

@ -64,6 +64,13 @@ void UBGraphicsWidgetItemDelegate::pin()
UBApplication::boardController->moveGraphicsWidgetToControlView(delegated()); UBApplication::boardController->moveGraphicsWidgetToControlView(delegated());
} }
void UBGraphicsWidgetItemDelegate::createControls()
{
UBGraphicsItemDelegate::createControls();
if (delegated() && delegated()->resizable())
frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
}
void UBGraphicsWidgetItemDelegate::updateMenuActionState() void UBGraphicsWidgetItemDelegate::updateMenuActionState()
{ {

@ -44,11 +44,12 @@ class UBGraphicsWidgetItemDelegate : public UBGraphicsItemDelegate
UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType = 0); UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType = 0);
virtual ~UBGraphicsWidgetItemDelegate(); virtual ~UBGraphicsWidgetItemDelegate();
virtual void createControls() override;
protected: protected:
virtual void decorateMenu(QMenu* menu); virtual void decorateMenu(QMenu* menu) override;
virtual void updateMenuActionState(); virtual void updateMenuActionState() override;
virtual void remove(bool canundo); virtual void remove(bool canundo) override;
private slots: private slots:

Loading…
Cancel
Save