|
41 | 41 | #include <Wt/WLineEdit>
|
42 | 42 | #include <Wt/WMenuItem>
|
43 | 43 | #include <Wt/WResource>
|
| 44 | +#include <Wt/WTabWidget> |
44 | 45 | #include <Wt/WPushButton>
|
45 | 46 | #include <Wt/Http/Request>
|
46 | 47 | #include <Wt/WApplication>
|
@@ -739,16 +740,32 @@ void ExportSpecFileTool::init()
|
739 | 740 |
|
740 | 741 | const bool showToolTips = InterSpecUser::preferenceValue<bool>( "ShowTooltips", m_interspec );
|
741 | 742 | const bool isMobile = m_interspec && m_interspec->isMobile();
|
| 743 | + |
| 744 | + const int screenWidth = m_interspec->renderedWidth(); |
| 745 | + const bool isPhone = (screenWidth > 100) ? (screenWidth < 640) : m_interspec->isPhone(); |
742 | 746 |
|
743 | 747 | if( isMobile )
|
744 | 748 | addStyleClass( "ExportSpecFileToolMobile" );
|
745 | 749 |
|
746 |
| - WContainerWidget *body = new WContainerWidget( this ); |
747 |
| - body->addStyleClass( "ExportSpecFileBody" ); |
| 750 | + WTabWidget *mobileTabs = nullptr; |
| 751 | + WContainerWidget *body = nullptr; |
| 752 | + |
| 753 | + if( isPhone ) |
| 754 | + { |
| 755 | + addStyleClass( "ExportSpecFileToolPhone" ); |
| 756 | + mobileTabs = new WTabWidget( this ); |
| 757 | + mobileTabs->addStyleClass( "ExportSpecFileTabs" ); |
| 758 | + }else |
| 759 | + { |
| 760 | + body = new WContainerWidget( this ); |
| 761 | + body->addStyleClass( "ExportSpecFileBody" ); |
| 762 | + } |
748 | 763 |
|
749 | 764 |
|
750 | 765 | WContainerWidget *fileSelectDiv = new WContainerWidget( body );
|
751 | 766 | fileSelectDiv->addStyleClass( "ExportSpecSelect" );
|
| 767 | + if( isPhone ) |
| 768 | + mobileTabs->addTab( fileSelectDiv, "File", Wt::WTabWidget::LoadPolicy::PreLoading ); |
752 | 769 |
|
753 | 770 | if( !m_specific_spectrum )
|
754 | 771 | {
|
@@ -795,6 +812,8 @@ void ExportSpecFileTool::init()
|
795 | 812 | // Spectrum format
|
796 | 813 | WContainerWidget *menuHolder = new WContainerWidget( body );
|
797 | 814 | menuHolder->addStyleClass( "ExportSpecFormat" );
|
| 815 | + if( isPhone ) |
| 816 | + mobileTabs->addTab( menuHolder, "Format", Wt::WTabWidget::LoadPolicy::PreLoading ); |
798 | 817 |
|
799 | 818 | WText *title = new WText( "File Format", menuHolder );
|
800 | 819 | title->addStyleClass( "ExportColTitle" );
|
@@ -864,6 +883,10 @@ void ExportSpecFileTool::init()
|
864 | 883 | // Meas/samples to include
|
865 | 884 | m_samplesHolder = new WContainerWidget( body );
|
866 | 885 | m_samplesHolder->addStyleClass( "ExportSpecSamples" );
|
| 886 | + |
| 887 | + if( isPhone ) |
| 888 | + mobileTabs->addTab( m_samplesHolder, "Options", Wt::WTabWidget::LoadPolicy::PreLoading ); |
| 889 | + |
867 | 890 | title = new WText( "Samples to Include", m_samplesHolder );
|
868 | 891 | title->addStyleClass( "ExportColTitle" );
|
869 | 892 |
|
@@ -3596,9 +3619,16 @@ ExportSpecFileWindow::ExportSpecFileWindow( InterSpec *viewer )
|
3596 | 3619 | addStyleClass( "export-spec-file" );
|
3597 | 3620 |
|
3598 | 3621 | const int w = viewer->renderedWidth();
|
3599 |
| - //setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 800.0) : 800.0 ,WLength::Pixel), WLength::Auto ); |
3600 |
| - setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 600.0) : 600.0 ,WLength::Pixel), WLength::Auto ); |
3601 |
| - |
| 3622 | + const bool isPhone = (w > 100) ? (w < 640) : (viewer && viewer->isPhone()); |
| 3623 | + |
| 3624 | + if( isPhone ) |
| 3625 | + { |
| 3626 | + resize( 320, Wt::WLength::Auto ); //320 px is about the smallest width Android phone to expect |
| 3627 | + }else |
| 3628 | + { |
| 3629 | + //setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 800.0) : 800.0 ,WLength::Pixel), WLength::Auto ); |
| 3630 | + setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 600.0) : 600.0 ,WLength::Pixel), WLength::Auto ); |
| 3631 | + } |
3602 | 3632 | m_tool = new ExportSpecFileTool( viewer, contents() );
|
3603 | 3633 | m_tool->done().connect( boost::bind(&ExportSpecFileWindow::accept, this) );
|
3604 | 3634 |
|
|
0 commit comments