Skip to content

Commit 788c1a8

Browse files
committed
Fix up file export layout for mobile, a little.
A few other small changes.
1 parent 9c8cd7c commit 788c1a8

File tree

6 files changed

+78
-33
lines changed

6 files changed

+78
-33
lines changed

InterSpec_resources/ExportSpecFile.css

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,17 @@
6363
{
6464
flex-grow: 2;
6565
margin-top: 5px;
66+
height: 330px;
6667
}
6768

68-
.ExportSpecFileTool .ExportSpecFileBody .ExportColTitle
69+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFileTabs > .Wt-stack
70+
{
71+
height: 300px;
72+
display: flex;
73+
flex-direction: column;
74+
}
75+
76+
.ExportSpecFileTool .ExportColTitle
6977
{
7078
display: block;
7179
white-space: nowrap;
@@ -92,6 +100,24 @@
92100
row-gap: 5px;
93101
}
94102

103+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect,
104+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat,
105+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSamples,
106+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecOptions
107+
{
108+
border: none;
109+
110+
margin-left: auto;
111+
margin-right: auto;
112+
margin-top: 10px;
113+
}
114+
115+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect,
116+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat,
117+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSamples
118+
{
119+
overflow-y: auto;
120+
}
95121

96122
.ExportSpecFileTool .ExportSpecSamples
97123
{
@@ -110,7 +136,7 @@
110136
margin-right: 5px;
111137
}
112138

113-
.ExportSpecFileTool .ExportSpecFileBody .ExportSpecSelect .ExportSpecInfo
139+
.ExportSpecFileTool .ExportSpecSelect .ExportSpecInfo
114140
{
115141
display: inline-block;
116142
overflow-y: auto;
@@ -133,9 +159,7 @@
133159

134160
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect
135161
{
136-
margin-left: auto;
137-
margin-right: auto;
138-
margin-top: 10px;
162+
139163
}
140164

141165
.ExportSpecInfo .ExportSpecInfoTable
@@ -175,13 +199,6 @@
175199
height: 100%;
176200
}
177201

178-
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat
179-
{
180-
height: 300px;
181-
overflow-y: auto;
182-
}
183-
184-
185202
.ExportSpecFileTool .ExportSpecFormat .ExportSpecFormatMenu.SideMenu
186203
{
187204
overflow-y: auto;
@@ -230,6 +247,11 @@
230247
border-bottom: none;
231248
}
232249

250+
.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecOptions
251+
{
252+
width: 100%;
253+
}
254+
233255
.ExportSpecFileTool .ExportSpecFileBody .ExportSpecOptions .ExportColTitle
234256
{
235257
}

InterSpec_resources/favicon.ico

15 KB
Binary file not shown.

data/config/wt_config_localweb.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@
594594
by setting this property, or for an individual application
595595
entry point by passing a location to WServer::addEntryPoint().
596596
-->
597-
<!-- <property name="favicon">images/favicon.ico</property> -->
597+
<property name="favicon">InterSpec_resources/favicon.ico</property>
598598
</properties>
599599

600600
</application-settings>

src/ExportSpecFile.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ const std::vector<std::pair<SpecUtils::SaveSpectrumAsType,std::string>> sm_file_
125125
#if( USE_QR_CODES )
126126
namespace
127127
{
128+
const int ns_min_screen_width_for_wide_layout = 750;
129+
128130
std::string clean_uuid( string uuid )
129131
{
130132
SpecUtils::trim(uuid);
@@ -741,18 +743,19 @@ void ExportSpecFileTool::init()
741743
const bool showToolTips = InterSpecUser::preferenceValue<bool>( "ShowTooltips", m_interspec );
742744
const bool isMobile = m_interspec && m_interspec->isMobile();
743745

744-
const int screenWidth = m_interspec->renderedWidth();
745-
const bool isPhone = (screenWidth > 100) ? (screenWidth < 640) : m_interspec->isPhone();
746-
747746
if( isMobile )
748747
addStyleClass( "ExportSpecFileToolMobile" );
749748

749+
const int screenWidth = m_interspec->renderedWidth();
750+
const bool isPhone = (screenWidth > 100) ? (screenWidth < ns_min_screen_width_for_wide_layout) : m_interspec->isPhone();
751+
750752
WTabWidget *mobileTabs = nullptr;
751753
WContainerWidget *body = nullptr;
752754

753755
if( isPhone )
754756
{
755757
addStyleClass( "ExportSpecFileToolPhone" );
758+
756759
mobileTabs = new WTabWidget( this );
757760
mobileTabs->addStyleClass( "ExportSpecFileTabs" );
758761
}else
@@ -3619,15 +3622,15 @@ ExportSpecFileWindow::ExportSpecFileWindow( InterSpec *viewer )
36193622
addStyleClass( "export-spec-file" );
36203623

36213624
const int w = viewer->renderedWidth();
3622-
const bool isPhone = (w > 100) ? (w < 640) : (viewer && viewer->isPhone());
3625+
const bool isPhone = (w > 100) ? (w < ns_min_screen_width_for_wide_layout) : (viewer && viewer->isPhone());
36233626

36243627
if( isPhone )
36253628
{
36263629
resize( 320, Wt::WLength::Auto ); //320 px is about the smallest width Android phone to expect
36273630
}else
36283631
{
36293632
//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 );
3633+
setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 650.0) : 650.0, WLength::Pixel), WLength::Auto );
36313634
}
36323635
m_tool = new ExportSpecFileTool( viewer, contents() );
36333636
m_tool->done().connect( boost::bind(&ExportSpecFileWindow::accept, this) );

src/InterSpec.cpp

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11039,24 +11039,44 @@ void InterSpec::setSpectrum( std::shared_ptr<SpecMeas> meas,
1103911039

1104011040
if( (spec_type == SpecUtils::SpectrumType::Foreground) && previous && (previous != meas) )
1104111041
{
11042-
closeShieldingSourceFit();
11042+
saveShieldingSourceModelToForegroundSpecMeas();
11043+
#if( USE_REL_ACT_TOOL )
11044+
saveRelActManualStateToForegroundSpecMeas();
11045+
saveRelActAutoStateToForegroundSpecMeas();
11046+
#endif
1104311047

1104411048
#if( USE_DB_TO_STORE_SPECTRA )
11045-
//if( m_user->preferenceValue<bool>( "AutoSaveSpectraToDb" ) )
11046-
//{
11047-
// //We also need to do this in the InterSpec destructor as well.
11048-
// // Also maybe change size limitations to only apply to auto saving
11049-
// if( current_state_index >= 0 )
11050-
// {
11051-
// //Save to (HEAD) of current state
11052-
// }else
11053-
// {
11054-
// //Create a state
11055-
// //Handle case where file is to large to be saved
11056-
// }
11057-
//}
11049+
/*
11050+
if( previous && m_user->preferenceValue<bool>( "AutoSaveSpectraToDb" ) )
11051+
{
11052+
//We also need to do this in the InterSpec destructor as well.
11053+
// Also maybe change size limitations to only apply to auto saving
11054+
const long long int current_state_index = currentAppStateDbId();
11055+
if( current_state_index >= 0 )
11056+
{
11057+
startStoreStateInDb( false, false, false, false ); //save snapshot
11058+
}else
11059+
{
11060+
m_fileManager->saveToDatabase( previous );
11061+
}
11062+
}//if(
11063+
*/
1105811064
#endif //#if( USE_DB_TO_STORE_SPECTRA )
1105911065

11066+
// Close Shielding/Source fit Window
11067+
if( m_shieldingSourceFitWindow )
11068+
{
11069+
delete m_shieldingSourceFitWindow;
11070+
m_shieldingSourceFitWindow = nullptr;
11071+
m_shieldingSourceFit = nullptr;
11072+
}
11073+
11074+
11075+
if( m_relActAutoGui )
11076+
{
11077+
// TODO: Should we close this?
11078+
}
11079+
1106011080
if( m_riidDisplay )
1106111081
programmaticallyCloseRiidResults();
1106211082
}//if( (spec_type == SpecUtils::SpectrumType::Foreground) && !!previous && (previous != meas) )

src/SpectraFileModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ std::shared_ptr<SpecMeas> SpectraFileHeader::resetFromDatabase(
343343
std::shared_ptr<SpecMeas> memobj = dbdata->decodeSpectrum();
344344
setMeasurmentInfo( memobj );
345345

346-
m_displayName = info->filename;
346+
m_displayName = SpecUtils::filename( info->filename );
347347
m_uploadTime = info->uploadTime;
348348
m_modifiedSinceDecode = info->userHasModified;
349349

0 commit comments

Comments
 (0)