From b62c1930fdebbb4b191a81eadf10da55c8b3ce56 Mon Sep 17 00:00:00 2001 From: textbrowser Date: Tue, 12 Sep 2023 08:15:11 -0400 Subject: [PATCH] Align image views. --- Documentation/Release-Notes.html | 1 + Source/biblioteq_a.cc | 1 + Source/biblioteq_b.cc | 3 +-- Source/biblioteq_c.cc | 3 ++- Source/biblioteq_photographcollection.cc | 12 +++++++----- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/Release-Notes.html b/Documentation/Release-Notes.html index dada7b35..c0ec43e4 100644 --- a/Documentation/Release-Notes.html +++ b/Documentation/Release-Notes.html @@ -6,6 +6,7 @@ photograph views.
  • Added shortcut tool tips to Other Options -> Shortcuts.
  • Administrator Browser: include Batch Activities Browser.
  • +
  • Align graphic views. These are views containing images.
  • Android and Qt 6.5.2 LTS.
  • Corrected book import: missing target_audience field in Template 2.
  • diff --git a/Source/biblioteq_a.cc b/Source/biblioteq_a.cc index f98b6edf..2222cfab 100644 --- a/Source/biblioteq_a.cc +++ b/Source/biblioteq_a.cc @@ -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); diff --git a/Source/biblioteq_b.cc b/Source/biblioteq_b.cc index a080542b..9606b8e6 100644 --- a/Source/biblioteq_b.cc +++ b/Source/biblioteq_b.cc @@ -178,8 +178,7 @@ int biblioteq::populateTable(const int search_type_arg, (0.0, 0.0, 150.0 * static_cast (columns), - static_cast (limit / static_cast (columns) * 200.0) + - 200.0); + (limit / static_cast (columns)) * 200.0 + 200.0); } QString bookFrontCover("'' AS front_cover "); diff --git a/Source/biblioteq_c.cc b/Source/biblioteq_c.cc index 42cf3bf8..c4433c95 100644 --- a/Source/biblioteq_c.cc +++ b/Source/biblioteq_c.cc @@ -431,7 +431,7 @@ int biblioteq::populateTable(QSqlQuery *query, (0.0, 0.0, 150.0 * static_cast (columns), - limit / (static_cast (columns)) * 200.0 + 200.0); + (limit / static_cast (columns)) * 200.0 + 200.0); } QApplication::setOverrideCursor(Qt::WaitCursor); @@ -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); diff --git a/Source/biblioteq_photographcollection.cc b/Source/biblioteq_photographcollection.cc index e93694ee..7e16ffb0 100644 --- a/Source/biblioteq_photographcollection.cc +++ b/Source/biblioteq_photographcollection.cc @@ -77,6 +77,7 @@ biblioteq_photographcollection::biblioteq_photographcollection photo.setupUi(m_photo_diag); photo.quantity->setMaximum(static_cast (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 &)), @@ -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)) @@ -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)