Skip to content

Commit

Permalink
Align image views.
Browse files Browse the repository at this point in the history
  • Loading branch information
textbrowser committed Sep 12, 2023
1 parent 6d9ec55 commit b62c193
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions Documentation/Release-Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
photograph views.</li>
<li>Added shortcut tool tips to Other Options -> Shortcuts.</li>
<li>Administrator Browser: include Batch Activities Browser.</li>
<li>Align graphic views. These are views containing images.</li>
<li>Android and Qt 6.5.2 LTS.</li>
<li>Corrected book import: missing target_audience field in
Template 2.</li>
Expand Down
1 change: 1 addition & 0 deletions Source/biblioteq_a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ biblioteq::biblioteq(void):QMainWindow()
SIGNAL(selectionChanged(void)),
this,
SLOT(slotSceneSelectionChanged(void)));
ui.graphicsView->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
ui.graphicsView->setDragMode(QGraphicsView::RubberBandDrag);
ui.graphicsView->setRubberBandSelectionMode(Qt::IntersectsItemShape);
ui.graphicsView->setScene(scene);
Expand Down
3 changes: 1 addition & 2 deletions Source/biblioteq_b.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ int biblioteq::populateTable(const int search_type_arg,
(0.0,
0.0,
150.0 * static_cast<qreal> (columns),
static_cast<qreal> (limit / static_cast<qreal> (columns) * 200.0) +
200.0);
(limit / static_cast<qreal> (columns)) * 200.0 + 200.0);
}

QString bookFrontCover("'' AS front_cover ");
Expand Down
3 changes: 2 additions & 1 deletion Source/biblioteq_c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ int biblioteq::populateTable(QSqlQuery *query,
(0.0,
0.0,
150.0 * static_cast<qreal> (columns),
limit / (static_cast<qreal> (columns)) * 200.0 + 200.0);
(limit / static_cast<qreal> (columns)) * 200.0 + 200.0);
}

QApplication::setOverrideCursor(Qt::WaitCursor);
Expand Down Expand Up @@ -3302,6 +3302,7 @@ void biblioteq::slotDisconnect(void)
ui.disconnectTool->setEnabled(false);
ui.duplicateTool->setEnabled(false);
ui.filesTool->setEnabled(false);
ui.graphicsView->setSceneRect(0.0, 0.0, 0.0, 0.0);
ui.menuEntriesPerPage->setEnabled(false);
ui.menu_Add_Item->setEnabled(false);
ui.modifyTool->setEnabled(false);
Expand Down
12 changes: 7 additions & 5 deletions Source/biblioteq_photographcollection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ biblioteq_photographcollection::biblioteq_photographcollection
photo.setupUi(m_photo_diag);
photo.quantity->setMaximum(static_cast<int> (biblioteq::Limits::QUANTITY));
photo.thumbnail_item->enableDoubleClickResize(false);
pc.graphicsView->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
pc.graphicsView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(pc.graphicsView,
SIGNAL(customContextMenuRequested(const QPoint &)),
Expand All @@ -87,10 +88,11 @@ biblioteq_photographcollection::biblioteq_photographcollection
pc.graphicsView->setRubberBandSelectionMode(Qt::IntersectsItemShape);

if(photographsPerPage() != -1) // Unlimited.
pc.graphicsView->setSceneRect(0.0,
0.0,
5.0 * 150.0,
photographsPerPage() / 5.0 * 200 + 15.0);
pc.graphicsView->setSceneRect
(0.0,
0.0,
5.0 * 150.0,
(photographsPerPage() / 5.0) * 200.0 + 200.0);

pc.thumbnail_item->setReadOnly(true);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
Expand Down Expand Up @@ -829,7 +831,7 @@ void biblioteq_photographcollection::search(const QString &field,
void biblioteq_photographcollection::setSceneRect(const qint64 size)
{
pc.graphicsView->setSceneRect
(0.0, 0.0, 5.0 * 150.0, size / 5.0 * 200.0 + 15.0);
(0.0, 0.0, 5.0 * 150.0, (size / 5.0) * 200.0 + 200.0);
}

void biblioteq_photographcollection::showPhotographs(const int page)
Expand Down

0 comments on commit b62c193

Please sign in to comment.