Skip to content

Commit

Permalink
Some slight tweaks to the "Spectrum Files" tab.
Browse files Browse the repository at this point in the history
Made so summary table is now at consistent height for foreground/background/secondary.
Added links/buttons to show the included RID results, or images embedded into the spectrum files.
  • Loading branch information
wcjohns committed Oct 24, 2024
1 parent 0807ecf commit e0a3660
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 7 deletions.
10 changes: 10 additions & 0 deletions InterSpec/CompactFileManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ class CompactFileManager : public Wt::WContainerWidget
/** Table giving a summary of current measurement. */
Wt::WTable *m_summaryTables[3];

/** Buttons, that look like links in lower right-hand corner, that will show the detectors RID results,
when they are present.
*/
Wt::WPushButton *m_showRidIdResult[3];

/** Buttons, that look like links in lower right-hand corner, that will show the images embedded in
the spectrum file, if present.
*/
Wt::WPushButton *m_showImage[3];

/** Buttons, that look like links in lower right-hand corner that when clicked bring up the
"File Parameters" dialog for this file
*/
Expand Down
32 changes: 26 additions & 6 deletions InterSpec_resources/CompactFileManager.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,39 @@ button.LinkBtn.GpsBtn, button.LinkBtn.GpsBtn:hover {
font-size: 6px;
}

button.LinkBtn.MoreInfoBtn, button.LinkBtn.MoreInfoBtn:hover {
float: right;
.CompactFileManager .BottomRow .InfoBtns {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: auto; /* makes float to right */
}

.CompactFileManager button.LinkBtn.MoreInfoBtn, .CompactFileManager button.LinkBtn.MoreInfoBtn:hover {
margin-right: 5px;
margin-left: auto; /* This is what makes the button float to the right side */
margin-left: 0px;
font-size: 6px;
height: 12px;
padding-left: 0px;
padding-right: 5px;
}

/* For background and secondary sections, add some margin below summary table, so they will be
at the same height as the foreground table (which has some additional buttons below the section)
*/
.CompactFileManager.LeftToRight .DispType.Background .SummaryTable, .CompactFileManager.LeftToRight .DispType.Secondary .SummaryTable {
margin-bottom: 23px;
}

/* The "Scale Factor:" input for background and secondary - add a little space*/
.CompactFileManager .DispType .ScaleFactorRow > input {
margin-left: 5px;
}

div.DispType .BottomRow {
width: 100%;
overflow-x: hidden;

flex-grow: 1;

display: flex;
flex-wrap: nowrap;
justify-content: flex-start;
Expand All @@ -189,7 +209,7 @@ div.DispType .BottomRow > div > button{
}

div.DispType div.ScaleFactorRow{
/* Make it so when the "Normalize" button disappears and reapears its doesnt cause this rows contents to move around a little. */
/* Make it so when the "Normalize" button disappears and reappears its doesnt cause this rows contents to move around a little. */
height: 23px;
}

Expand Down
2 changes: 2 additions & 0 deletions InterSpec_resources/app_text/CompactFileManager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<message id='cfm-norm-btn'>Normalize</message>
<message id='cfm-more-info-btn'>further info</message>
<message id='cfm-show-rid-result-btn'>RID results</message>
<message id='cfm-show-image-btn'>embedded image</message>

<message id='cfm-db-spec'>Prev. Saved Spectra</message>

Expand Down
30 changes: 29 additions & 1 deletion src/CompactFileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ CompactFileManager::CompactFileManager( SpecMeasManager *fileManager,
m_previousSampleTxt{ WString() },
m_titles{ nullptr },
m_summaryTables{ nullptr },
m_showRidIdResult{ nullptr },
m_showImage{ nullptr },
m_moreInfoBtn{ nullptr },
m_files( fileManager->model() ),
m_interspec( hostViewer ),
Expand Down Expand Up @@ -317,7 +319,22 @@ CompactFileManager::CompactFileManager( SpecMeasManager *fileManager,
m_scaleValueTxt[typeindex]->disable();
}//if( type == SpecUtils::SpectrumType::Foreground ) / else

m_moreInfoBtn[typeindex] = new WPushButton( WString::tr("cfm-more-info-btn"), bottomrow );
WContainerWidget *btndiv = new WContainerWidget( bottomrow );
btndiv->addStyleClass( "InfoBtns" );

m_showRidIdResult[typeindex] = new WPushButton( WString::tr("cfm-show-rid-result-btn"), btndiv );
m_showRidIdResult[typeindex]->addStyleClass( "LinkBtn MoreInfoBtn" );
m_showRidIdResult[typeindex]->clicked().connect( boost::bind( &InterSpec::showRiidResults, m_interspec, type ) );
//HelpSystem::attachToolTipOn( m_showRidIdResult[typeindex], WString::tr("app-mi-tt-view-rid"), showToolTips );
m_showRidIdResult[typeindex]->hide();

m_showImage[typeindex] = new WPushButton( WString::tr("cfm-show-image-btn"), btndiv );
m_showImage[typeindex]->addStyleClass( "LinkBtn MoreInfoBtn" );
m_showImage[typeindex]->clicked().connect( boost::bind( &InterSpec::showMultimedia, m_interspec, type ) );
//HelpSystem::attachToolTipOn( m_showImage[typeindex], WString::tr("app-mi-tt-view-img"), showToolTips );
m_showImage[typeindex]->hide();

m_moreInfoBtn[typeindex] = new WPushButton( WString::tr("cfm-more-info-btn"), btndiv );
m_moreInfoBtn[typeindex]->addStyleClass( "LinkBtn MoreInfoBtn" );
m_moreInfoBtn[typeindex]->clicked().connect( boost::bind(&InterSpec::createFileParameterWindow, m_interspec, type) );
m_moreInfoBtn[typeindex]->hide();
Expand Down Expand Up @@ -395,6 +412,8 @@ void CompactFileManager::handleFileChangeRequest( int row, SpecUtils::SpectrumTy
m_summaryTables[typeindex]->clear();
m_summaryTables[typeindex]->hide();
m_spectrumLineLegend[typeindex]->hide();
m_showRidIdResult[typeindex]->hide();
m_showImage[typeindex]->hide();
m_moreInfoBtn[typeindex]->hide();

return;
Expand Down Expand Up @@ -736,11 +755,20 @@ void CompactFileManager::handleDisplayChange( SpecUtils::SpectrumType spectrum_t
if( m_rescaleByLiveTime[typeindex] )
m_rescaleByLiveTime[typeindex]->hide();
m_spectrumLineLegend[typeindex]->hide();
m_showRidIdResult[typeindex]->hide();
m_showImage[typeindex]->hide();
m_moreInfoBtn[typeindex]->hide();
return;
}//if( !meas )

m_spectrumLineLegend[typeindex]->show();

const bool showRiid = !!meas->detectors_analysis();
m_showRidIdResult[typeindex]->setHidden( !showRiid );

const bool showPics = (meas->multimedia_data().size() > 0);
m_showImage[typeindex]->setHidden( !showPics );

m_moreInfoBtn[typeindex]->show();

if( m_scaleValueRow[typeindex] )
Expand Down

0 comments on commit e0a3660

Please sign in to comment.