Files
mmd-pdf/Shell/Scan.cs
T
kua-agentandClaude Opus 5 39130f41e6 feat: one merged MMD band, Scan in the main bar, shorter icon row, signed build
Ben, 2026-08-28: four changes, then build it, sign it, and make it deployable
through Intune without alerts.

1. The row of icons is a fifth shorter. Every toolbar label mode comes down
   together so the proportions between them are unchanged: 34 -> 27 for a
   caption beside the icon, 52/56 -> 42/45 for a caption under it, with the
   padding reduced to match. The row measures 48px on screen where it was 60.

2. Scan sits in the main bar. It is a solid white button on the band, to the
   left of the window buttons, so a person can pull pages off a copier whatever
   the toolbar is showing. Behind it, Services/ScanService.cs talks to the
   copier through WIA - the imaging service that ships with Windows, reached
   late-bound so a machine without it fails at a check instead of at load - and
   Features/Scan/ScanDialog picks the copier, the feed, the colour, the detail
   and the paper. Pages come back as images and take the same route into a
   document as an imported photograph. "Make the words searchable" runs the
   text recognition the application already carries.

3. The official MMD lockup, in white, because the band is red now.

4. The MMD design system locked on 2026-08-28: ONE merged top bar carrying the
   mark, the name, the tabs and the tools; 4px corners; 24px window buttons;
   the bevel on title bars only. Colours are NOT adjusted - the Red Plate
   silver and ink set already in Themes/MMD.xaml is untouched.

Also fixed, both found by looking at the running application at 800x600:

  - The default 1000x700 window does not fit an 800x600 plant screen, and a
    window taller than the screen puts its own title bar - and therefore Scan,
    the window buttons and the tabs - above the top edge where nobody can reach
    them. MainWindow now starts maximised when the screen cannot hold the
    default.
  - The close button was invisible: CaptionCloseBrush defaults to the danger
    red, which on a red band is red on red. The window buttons are white now,
    and close inverts to a white plate with a red cross on hover.

Built and run on mmd-win-test-01 at 800x600 through keyboard and mouse only.
Signed with the internal MMD code-signing certificate and timestamped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 03:25:42 +00:00

41 lines
1.4 KiB
C#

using System;
using System.Globalization;
using System.Windows;
using MmdPdf.Controls;
using MmdPdf.Features.Scan;
namespace MmdPdf
{
// Pulling pages off a copier. The dialog does the talking to the hardware; this file only
// turns the pages it hands back into a document, which is the same route an imported
// photograph takes (ImportAndZip.cs).
public partial class MainWindow
{
private void Scan_Click(object sender, RoutedEventArgs e)
{
var dlg = new ScanDialog { Owner = this };
bool? answer;
try
{
answer = dlg.ShowDialog();
}
catch (Exception ex)
{
KillerDialog.Show(this, "The copier could not be reached.\n" + ex.Message,
"MMD PDF", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
if (answer != true || dlg.Pages.Length == 0) return;
string name = "Scan " + DateTime.Now.ToString("d MMM yyyy HH:mm", CultureInfo.CurrentCulture);
OpenImagesAsImportedTab(dlg.Pages, name);
// "Make the words searchable" is the copier setting a person ticks before the run;
// the reading itself happens here, on the document that just opened, through the
// text recognition the application already carries.
if (dlg.MakeSearchable) MakeSearchablePdf();
}
}
}