Changeset 71515 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 26, 2018 2:32:57 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121488
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.cpp
r70474 r71515 5 5 6 6 /* 7 * Copyright (C) 2013-201 7Oracle Corporation7 * Copyright (C) 2013-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 26 26 /* GUI includes: */ 27 # include "UIAnimationFramework.h" 27 28 # include "UIPopupPaneDetails.h" 28 # include "UIAnimationFramework.h"29 29 30 30 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 106 106 } 107 107 108 void UIPopupPaneDetails::updateVisibility()109 {110 if (m_fFocused && !m_strText.isEmpty())111 show();112 else113 hide();114 }115 116 108 void UIPopupPaneDetails::sltHandleProposalForWidth(int iWidth) 117 109 { … … 189 181 /* Create text-editor: */ 190 182 m_pTextEdit = new QTextEdit(this); 183 if (m_pTextEdit) 191 184 { 192 185 /* Configure text-editor: */ … … 245 238 } 246 239 240 void UIPopupPaneDetails::updateVisibility() 241 { 242 if (m_fFocused && !m_strText.isEmpty()) 243 show(); 244 else 245 hide(); 246 } 247 247 248 /* static */ 248 249 QFont UIPopupPaneDetails::tuneFont(QFont font) … … 255 256 return font; 256 257 } 258 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.h
r69500 r71515 5 5 6 6 /* 7 * Copyright (C) 2013-201 7Oracle Corporation7 * Copyright (C) 2013-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 class UIAnimation; 27 27 28 /* Popup-pane text-pane prototype class:*/28 /** QWidget extension providing GUI with popup-pane details-pane prototype class. */ 29 29 class UIPopupPaneDetails : public QWidget 30 30 { … … 36 36 signals: 37 37 38 /* Notifiers: Parent propagation stuff:*/38 /** Notifies about focus enter. */ 39 39 void sigFocusEnter(); 40 /** Notifies about focus enter. */ 40 41 void sigFocusLeave(); 41 42 42 /* Notifier: Layout stuff:*/43 /** Notifies about size-hint change. */ 43 44 void sigSizeHintChanged(); 44 45 45 46 public: 46 47 47 /* Constructor: */ 48 /** Constructs details-pane passing @a pParent to the base-class. 49 * @param strText Brings the details text. 50 * @param fFcoused Brings whether the pane is focused. */ 48 51 UIPopupPaneDetails(QWidget *pParent, const QString &strText, bool fFocused); 49 52 50 /* API: Text stuff:*/53 /** Defines the details @a strText. */ 51 54 void setText(const QString &strText); 52 55 53 /* API: Layout stuff:*/56 /** Returns the details minimum size-hint. */ 54 57 QSize minimumSizeHint() const; 58 /** Defines the details @a minimumSizeHint. */ 55 59 void setMinimumSizeHint(const QSize &minimumSizeHint); 60 /** Lays the content out. */ 56 61 void layoutContent(); 57 62 58 /* Property: Focus stuff:*/63 /** Returns the collapsed size-hint. */ 59 64 QSize collapsedSizeHint() const { return m_collapsedSizeHint; } 65 /** Returns the expanded size-hint. */ 60 66 QSize expandedSizeHint() const { return m_expandedSizeHint; } 61 67 62 68 public slots: 63 69 64 /* Handlers: Layout stuff:*/70 /** Handles proposal for @a iWidth. */ 65 71 void sltHandleProposalForWidth(int iWidth); 72 /** Handles proposal for @a iHeight. */ 66 73 void sltHandleProposalForHeight(int iHeight); 67 74 68 /* Handlers: Focus stuff:*/75 /** Handles focus enter. */ 69 76 void sltFocusEnter(); 77 /** Handles focus leave. */ 70 78 void sltFocusLeave(); 71 79 72 80 private: 73 81 74 /* Helpers: Prepare stuff:*/82 /** Prepares all. */ 75 83 void prepare(); 84 /** Prepares content. */ 76 85 void prepareContent(); 86 /** Prepares animations. */ 77 87 void prepareAnimation(); 78 88 79 /* Helper: Layout stuff:*/89 /** Updates size-hint. */ 80 90 void updateSizeHint(); 91 /** Updates visibility. */ 81 92 void updateVisibility(); 82 93 83 /* Static helper: Font stuff:*/94 /** Adjusts @a font. */ 84 95 static QFont tuneFont(QFont font); 85 96 86 /* Variables: Layout stuff:*/97 /** Holds the layout margin. */ 87 98 const int m_iLayoutMargin; 99 /** Holds the layout spacing. */ 88 100 const int m_iLayoutSpacing; 101 102 /** Holds the text-editor size-hint. */ 89 103 QSize m_textEditSizeHint; 104 /** Holds the collapsed size-hint. */ 90 105 QSize m_collapsedSizeHint; 106 /** Holds the expanded size-hint. */ 91 107 QSize m_expandedSizeHint; 108 /** Holds the minimum size-hint. */ 92 109 QSize m_minimumSizeHint; 93 110 94 /* Variables: Widget stuff:*/111 /** Holds the text. */ 95 112 QString m_strText; 113 114 /** Holds the text-editor instance. */ 96 115 QTextEdit *m_pTextEdit; 116 117 /** Holds the desired textr-editor width. */ 97 118 int m_iDesiredTextEditWidth; 119 /** Holds the maximum pane height. */ 98 120 int m_iMaximumPaneHeight; 121 /** Holds the desired textr-editor height. */ 99 122 int m_iMaximumTextEditHeight; 123 /** Holds the text content margin. */ 100 124 int m_iTextContentMargin; 101 125 102 /* Variables: Focus stuff:*/126 /** Holds whether details-pane is focused. */ 103 127 bool m_fFocused; 128 129 /** Holds the animation instance. */ 104 130 UIAnimation *m_pAnimation; 105 131 }; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneMessage.cpp
r69500 r71515 5 5 6 6 /* 7 * Copyright (C) 2013-201 7Oracle Corporation7 * Copyright (C) 2013-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 25 25 /* GUI includes: */ 26 # include "UIAnimationFramework.h" 26 27 # include "UIPopupPaneMessage.h" 27 # include "UIAnimationFramework.h"28 28 29 29 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 148 148 /* Create label: */ 149 149 m_pLabel = new QLabel(this); 150 if (m_pLabel) 150 151 { 151 152 /* Configure label: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneMessage.h
r69500 r71515 5 5 6 6 /* 7 * Copyright (C) 2013-201 7Oracle Corporation7 * Copyright (C) 2013-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 class UIAnimation; 27 27 28 /* Popup-pane text-pane prototype class:*/28 /** QWidget extension providing GUI with popup-pane message-pane prototype class. */ 29 29 class UIPopupPaneMessage : public QWidget 30 30 { … … 36 36 signals: 37 37 38 /* Notifiers: Parent propagation stuff:*/38 /** Notifies about focus enter. */ 39 39 void sigFocusEnter(); 40 /** Notifies about focus enter. */ 40 41 void sigFocusLeave(); 41 42 42 /* Notifier: Layout stuff:*/43 /** Notifies about size-hint change. */ 43 44 void sigSizeHintChanged(); 44 45 45 46 public: 46 47 47 /* Constructor: */ 48 /** Constructs message-pane passing @a pParent to the base-class. 49 * @param strText Brings the message text. 50 * @param fFcoused Brings whether the pane is focused. */ 48 51 UIPopupPaneMessage(QWidget *pParent, const QString &strText, bool fFocused); 49 52 50 /* API: Text stuff:*/53 /** Defines the message @a strText. */ 51 54 void setText(const QString &strText); 52 55 53 /* API: Layout stuff:*/56 /** Returns the message minimum size-hint. */ 54 57 QSize minimumSizeHint() const; 58 /** Defines the message @a minimumSizeHint. */ 55 59 void setMinimumSizeHint(const QSize &minimumSizeHint); 60 /** Lays the content out. */ 56 61 void layoutContent(); 57 62 58 /* Property: Focus stuff:*/63 /** Returns the collapsed size-hint. */ 59 64 QSize collapsedSizeHint() const { return m_collapsedSizeHint; } 65 /** Returns the expanded size-hint. */ 60 66 QSize expandedSizeHint() const { return m_expandedSizeHint; } 61 67 62 68 private slots: 63 69 64 /* Handler: Layout stuff:*/70 /** Handles proposal for @a iWidth. */ 65 71 void sltHandleProposalForWidth(int iWidth); 66 72 67 /* Handlers: Focus stuff:*/73 /** Handles focus enter. */ 68 74 void sltFocusEnter(); 75 /** Handles focus leave. */ 69 76 void sltFocusLeave(); 70 77 71 78 private: 72 79 73 /* Helpers: Prepare stuff:*/80 /** Prepares all. */ 74 81 void prepare(); 82 /** Prepares content. */ 75 83 void prepareContent(); 84 /** Prepares animations. */ 76 85 void prepareAnimation(); 77 86 78 /* Helper: Layout stuff:*/87 /** Updates size-hint. */ 79 88 void updateSizeHint(); 80 89 81 /* Static helper: Font stuff:*/90 /** Adjusts @a font. */ 82 91 static QFont tuneFont(QFont font); 83 92 84 /* Variables: Layout stuff:*/93 /** Holds the layout margin. */ 85 94 const int m_iLayoutMargin; 95 /** Holds the layout spacing. */ 86 96 const int m_iLayoutSpacing; 97 98 /** Holds the label size-hint. */ 87 99 QSize m_labelSizeHint; 100 /** Holds the collapsed size-hint. */ 88 101 QSize m_collapsedSizeHint; 102 /** Holds the expanded size-hint. */ 89 103 QSize m_expandedSizeHint; 104 /** Holds the minimum size-hint. */ 90 105 QSize m_minimumSizeHint; 91 106 92 /* Variables: Widget stuff:*/107 /** Holds the text. */ 93 108 QString m_strText; 109 110 /** Holds the label instance. */ 94 111 QLabel *m_pLabel; 112 113 /** Holds the desired label width. */ 95 114 int m_iDesiredLabelWidth; 96 115 97 /* Variables: Focus stuff:*/116 /** Holds whether message-pane is focused. */ 98 117 bool m_fFocused; 118 119 /** Holds the animation instance. */ 99 120 UIAnimation *m_pAnimation; 100 121 };
Note:
See TracChangeset
for help on using the changeset viewer.