mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:50:04 +00:00 
			
		
		
		
	Add animation dock widget
This commit is contained in:
		
							parent
							
								
									5ad148a1a8
								
							
						
					
					
						commit
						0d44513d0a
					
				
					 9 changed files with 309 additions and 8 deletions
				
			
		|  | @ -15,6 +15,7 @@ | |||
| #include <scwx/qt/ui/alert_dock_widget.hpp> | ||||
| #include <scwx/qt/ui/flow_layout.hpp> | ||||
| #include <scwx/qt/ui/about_dialog.hpp> | ||||
| #include <scwx/qt/ui/animation_dock_widget.hpp> | ||||
| #include <scwx/qt/ui/imgui_debug_dialog.hpp> | ||||
| #include <scwx/qt/ui/level2_products_widget.hpp> | ||||
| #include <scwx/qt/ui/level2_settings_widget.hpp> | ||||
|  | @ -62,6 +63,7 @@ public: | |||
|        level2SettingsWidget_ {nullptr}, | ||||
|        level3ProductsWidget_ {nullptr}, | ||||
|        alertDockWidget_ {nullptr}, | ||||
|        animationDockWidget_ {nullptr}, | ||||
|        aboutDialog_ {nullptr}, | ||||
|        imGuiDebugDialog_ {nullptr}, | ||||
|        radarSiteDialog_ {nullptr}, | ||||
|  | @ -138,12 +140,13 @@ public: | |||
| 
 | ||||
|    ui::Level3ProductsWidget* level3ProductsWidget_; | ||||
| 
 | ||||
|    ui::AlertDockWidget*  alertDockWidget_; | ||||
|    ui::AboutDialog*      aboutDialog_; | ||||
|    ui::ImGuiDebugDialog* imGuiDebugDialog_; | ||||
|    ui::RadarSiteDialog*  radarSiteDialog_; | ||||
|    ui::SettingsDialog*   settingsDialog_; | ||||
|    ui::UpdateDialog*     updateDialog_; | ||||
|    ui::AlertDockWidget*     alertDockWidget_; | ||||
|    ui::AnimationDockWidget* animationDockWidget_; | ||||
|    ui::AboutDialog*         aboutDialog_; | ||||
|    ui::ImGuiDebugDialog*    imGuiDebugDialog_; | ||||
|    ui::RadarSiteDialog*     radarSiteDialog_; | ||||
|    ui::SettingsDialog*      settingsDialog_; | ||||
|    ui::UpdateDialog*        updateDialog_; | ||||
| 
 | ||||
|    std::unique_ptr<model::RadarProductModel>  radarProductModel_; | ||||
|    std::shared_ptr<manager::TextEventManager> textEventManager_; | ||||
|  | @ -182,12 +185,23 @@ MainWindow::MainWindow(QWidget* parent) : | |||
|    p->alertDockWidget_->setVisible(false); | ||||
|    addDockWidget(Qt::BottomDockWidgetArea, p->alertDockWidget_); | ||||
| 
 | ||||
|    // Animation Dock Widget
 | ||||
|    p->animationDockWidget_ = new ui::AnimationDockWidget(this); | ||||
|    p->animationDockWidget_->setVisible(true); | ||||
|    addDockWidget(Qt::LeftDockWidgetArea, p->animationDockWidget_); | ||||
| 
 | ||||
|    // Configure Menu
 | ||||
|    ui->menuView->insertAction(ui->actionRadarToolbox, | ||||
|                               ui->radarToolboxDock->toggleViewAction()); | ||||
|    ui->radarToolboxDock->toggleViewAction()->setText(tr("Radar &Toolbox")); | ||||
|    ui->actionRadarToolbox->setVisible(false); | ||||
| 
 | ||||
|    ui->menuView->insertAction(ui->actionAnimationToolbox, | ||||
|                               p->animationDockWidget_->toggleViewAction()); | ||||
|    p->animationDockWidget_->toggleViewAction()->setText( | ||||
|       tr("A&nimation Toolbox")); | ||||
|    ui->actionAnimationToolbox->setVisible(false); | ||||
| 
 | ||||
|    ui->menuView->insertAction(ui->actionResourceExplorer, | ||||
|                               ui->resourceExplorerDock->toggleViewAction()); | ||||
|    ui->resourceExplorerDock->toggleViewAction()->setText( | ||||
|  | @ -273,7 +287,7 @@ void MainWindow::showEvent(QShowEvent* event) | |||
| { | ||||
|    QMainWindow::showEvent(event); | ||||
| 
 | ||||
|    resizeDocks({ui->radarToolboxDock}, {150}, Qt::Horizontal); | ||||
|    resizeDocks({ui->radarToolboxDock}, {188}, Qt::Horizontal); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionOpenNexrad_triggered() | ||||
|  |  | |||
|  | @ -76,6 +76,7 @@ | |||
|      <string>&View</string> | ||||
|     </property> | ||||
|     <addaction name="actionRadarToolbox"/> | ||||
|     <addaction name="actionAnimationToolbox"/> | ||||
|     <addaction name="actionResourceExplorer"/> | ||||
|     <addaction name="actionAlerts"/> | ||||
|    </widget> | ||||
|  | @ -359,7 +360,7 @@ | |||
|   </action> | ||||
|   <action name="actionRadarToolbox"> | ||||
|    <property name="text"> | ||||
|     <string>Radar Toolbox</string> | ||||
|     <string>Radar &Toolbox</string> | ||||
|    </property> | ||||
|   </action> | ||||
|   <action name="actionResourceExplorer"> | ||||
|  | @ -429,6 +430,11 @@ | |||
|     <string>&Check for Updates</string> | ||||
|    </property> | ||||
|   </action> | ||||
|   <action name="actionAnimationToolbox"> | ||||
|    <property name="text"> | ||||
|     <string>A&nimation Toolbox</string> | ||||
|    </property> | ||||
|   </action> | ||||
|  </widget> | ||||
|  <resources> | ||||
|   <include location="../../../../scwx-qt.qrc"/> | ||||
|  |  | |||
							
								
								
									
										38
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| #include "animation_dock_widget.hpp" | ||||
| #include "ui_animation_dock_widget.h" | ||||
| 
 | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace ui | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "scwx::qt::ui::animation_dock_widget"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class AnimationDockWidgetImpl | ||||
| { | ||||
| public: | ||||
|    explicit AnimationDockWidgetImpl() = default; | ||||
|    ~AnimationDockWidgetImpl()         = default; | ||||
| }; | ||||
| 
 | ||||
| AnimationDockWidget::AnimationDockWidget(QWidget* parent) : | ||||
|     QDockWidget(parent), | ||||
|     p {std::make_unique<AnimationDockWidgetImpl>()}, | ||||
|     ui(new Ui::AnimationDockWidget) | ||||
| { | ||||
|    ui->setupUi(this); | ||||
| } | ||||
| 
 | ||||
| AnimationDockWidget::~AnimationDockWidget() | ||||
| { | ||||
|    delete ui; | ||||
| } | ||||
| 
 | ||||
| } // namespace ui
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
							
								
								
									
										35
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <QDockWidget> | ||||
| 
 | ||||
| namespace Ui | ||||
| { | ||||
| class AnimationDockWidget; | ||||
| } | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace ui | ||||
| { | ||||
| 
 | ||||
| class AnimationDockWidgetImpl; | ||||
| 
 | ||||
| class AnimationDockWidget : public QDockWidget | ||||
| { | ||||
|    Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|    explicit AnimationDockWidget(QWidget* parent = nullptr); | ||||
|    ~AnimationDockWidget(); | ||||
| 
 | ||||
| private: | ||||
|    friend class AnimationDockWidgetImpl; | ||||
|    std::unique_ptr<AnimationDockWidgetImpl> p; | ||||
|    Ui::AnimationDockWidget*                 ui; | ||||
| }; | ||||
| 
 | ||||
| } // namespace ui
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
							
								
								
									
										201
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.ui
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										201
									
								
								scwx-qt/source/scwx/qt/ui/animation_dock_widget.ui
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,201 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>AnimationDockWidget</class> | ||||
|  <widget class="QDockWidget" name="AnimationDockWidget"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>200</width> | ||||
|     <height>335</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Animation Toolbox</string> | ||||
|   </property> | ||||
|   <widget class="QWidget" name="dockWidgetContents"> | ||||
|    <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|     <item> | ||||
|      <widget class="QGroupBox" name="timelineGroupBox"> | ||||
|       <property name="title"> | ||||
|        <string>Timeline</string> | ||||
|       </property> | ||||
|       <layout class="QVBoxLayout" name="verticalLayout_6"> | ||||
|        <item> | ||||
|         <widget class="QRadioButton" name="liveViewRadioButton"> | ||||
|          <property name="text"> | ||||
|           <string>Live View</string> | ||||
|          </property> | ||||
|          <property name="checked"> | ||||
|           <bool>true</bool> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QRadioButton" name="archiveViewRadioButton"> | ||||
|          <property name="text"> | ||||
|           <string>Archive View</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QDateEdit" name="dateEdit"> | ||||
|          <property name="minimumDateTime"> | ||||
|           <datetime> | ||||
|            <hour>0</hour> | ||||
|            <minute>0</minute> | ||||
|            <second>0</second> | ||||
|            <year>1991</year> | ||||
|            <month>9</month> | ||||
|            <day>14</day> | ||||
|           </datetime> | ||||
|          </property> | ||||
|          <property name="displayFormat"> | ||||
|           <string>yyyy-MM-dd</string> | ||||
|          </property> | ||||
|          <property name="calendarPopup"> | ||||
|           <bool>true</bool> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QTimeEdit" name="timeEdit"> | ||||
|          <property name="displayFormat"> | ||||
|           <string>HH:mm t</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QLabel" name="loopTimeLabel"> | ||||
|          <property name="text"> | ||||
|           <string>Loop Time (Minutes)</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QSpinBox" name="loopTimeSpinBox"> | ||||
|          <property name="value"> | ||||
|           <number>30</number> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QLabel" name="loopSpeedLabel"> | ||||
|          <property name="text"> | ||||
|           <string>Loop Speed</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QDoubleSpinBox" name="loopSpeedSpinBox"> | ||||
|          <property name="value"> | ||||
|           <double>1.000000000000000</double> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QFrame" name="frame_2"> | ||||
|          <property name="frameShape"> | ||||
|           <enum>QFrame::StyledPanel</enum> | ||||
|          </property> | ||||
|          <property name="frameShadow"> | ||||
|           <enum>QFrame::Raised</enum> | ||||
|          </property> | ||||
|          <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||||
|           <property name="spacing"> | ||||
|            <number>1</number> | ||||
|           </property> | ||||
|           <property name="leftMargin"> | ||||
|            <number>0</number> | ||||
|           </property> | ||||
|           <property name="topMargin"> | ||||
|            <number>0</number> | ||||
|           </property> | ||||
|           <property name="rightMargin"> | ||||
|            <number>0</number> | ||||
|           </property> | ||||
|           <property name="bottomMargin"> | ||||
|            <number>0</number> | ||||
|           </property> | ||||
|           <item> | ||||
|            <widget class="QToolButton" name="beginButton"> | ||||
|             <property name="text"> | ||||
|              <string>...</string> | ||||
|             </property> | ||||
|             <property name="icon"> | ||||
|              <iconset resource="../../../../scwx-qt.qrc"> | ||||
|               <normaloff>:/res/icons/font-awesome-6/backward-step-solid.svg</normaloff>:/res/icons/font-awesome-6/backward-step-solid.svg</iconset> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QToolButton" name="stepBackButton"> | ||||
|             <property name="text"> | ||||
|              <string>...</string> | ||||
|             </property> | ||||
|             <property name="icon"> | ||||
|              <iconset resource="../../../../scwx-qt.qrc"> | ||||
|               <normaloff>:/res/icons/font-awesome-6/angle-left-solid.svg</normaloff>:/res/icons/font-awesome-6/angle-left-solid.svg</iconset> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QToolButton" name="playButton"> | ||||
|             <property name="text"> | ||||
|              <string>...</string> | ||||
|             </property> | ||||
|             <property name="icon"> | ||||
|              <iconset resource="../../../../scwx-qt.qrc"> | ||||
|               <normaloff>:/res/icons/font-awesome-6/play-solid.svg</normaloff>:/res/icons/font-awesome-6/play-solid.svg</iconset> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QToolButton" name="stepNextButton"> | ||||
|             <property name="text"> | ||||
|              <string>...</string> | ||||
|             </property> | ||||
|             <property name="icon"> | ||||
|              <iconset resource="../../../../scwx-qt.qrc"> | ||||
|               <normaloff>:/res/icons/font-awesome-6/angle-right-solid.svg</normaloff>:/res/icons/font-awesome-6/angle-right-solid.svg</iconset> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QToolButton" name="endButton"> | ||||
|             <property name="text"> | ||||
|              <string>...</string> | ||||
|             </property> | ||||
|             <property name="icon"> | ||||
|              <iconset resource="../../../../scwx-qt.qrc"> | ||||
|               <normaloff>:/res/icons/font-awesome-6/forward-step-solid.svg</normaloff>:/res/icons/font-awesome-6/forward-step-solid.svg</iconset> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|          </layout> | ||||
|         </widget> | ||||
|        </item> | ||||
|       </layout> | ||||
|      </widget> | ||||
|     </item> | ||||
|     <item> | ||||
|      <spacer name="verticalSpacer"> | ||||
|       <property name="orientation"> | ||||
|        <enum>Qt::Vertical</enum> | ||||
|       </property> | ||||
|       <property name="sizeHint" stdset="0"> | ||||
|        <size> | ||||
|         <width>20</width> | ||||
|         <height>40</height> | ||||
|        </size> | ||||
|       </property> | ||||
|      </spacer> | ||||
|     </item> | ||||
|    </layout> | ||||
|   </widget> | ||||
|  </widget> | ||||
|  <resources> | ||||
|   <include location="../../../../scwx-qt.qrc"/> | ||||
|  </resources> | ||||
|  <connections/> | ||||
| </ui> | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat