mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-04-21 19:24:00 +00:00
最大化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using Cosmos.System.Graphics;
|
||||
using System.Drawing;
|
||||
@@ -51,6 +51,29 @@ namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void WindowResized()
|
||||
{
|
||||
int editorHeight = mainWindow.Height - headersHeight - problemsHeight - outputHeight - (headersHeight * 3);
|
||||
editor.Move(0, headersHeight);
|
||||
editor.Resize(mainWindow.Width, editorHeight);
|
||||
editor.MarkAllLines();
|
||||
editor.Render();
|
||||
|
||||
problems.Move(0, headersHeight + editorHeight + headersHeight);
|
||||
problems.Resize(mainWindow.Width, problemsHeight + (headersHeight * 2));
|
||||
problems.MarkAllLines();
|
||||
problems.Render();
|
||||
|
||||
output.Move(0, headersHeight + editorHeight + problemsHeight + (headersHeight * 2));
|
||||
output.Resize(mainWindow.Width, outputHeight + (headersHeight * 2));
|
||||
output.MarkAllLines();
|
||||
output.Render();
|
||||
|
||||
mainWindow.Clear(Theme.Background);
|
||||
mainWindow.DrawString("Problems", Color.White, 0, headersHeight + editorHeight);
|
||||
mainWindow.DrawString("Output", Color.White, 0, headersHeight + editorHeight + problemsHeight + headersHeight);
|
||||
}
|
||||
|
||||
private static class Theme
|
||||
{
|
||||
@@ -254,6 +277,8 @@ namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
mainWindow = new AppWindow(process, 96, 96, 800, 600);
|
||||
mainWindow.Clear(Theme.Background);
|
||||
mainWindow.Closing = process.TryStop;
|
||||
mainWindow.CanResize = true;
|
||||
mainWindow.UserResized = WindowResized;
|
||||
UpdateTitle();
|
||||
wm.AddWindow(mainWindow);
|
||||
|
||||
|
||||
@@ -328,10 +328,10 @@ namespace CMLeonOS.Gui.UILib
|
||||
|
||||
internal override void Render()
|
||||
{
|
||||
Clear(_background);
|
||||
|
||||
if (Text == string.Empty)
|
||||
{
|
||||
Clear(_background);
|
||||
|
||||
DrawRectangle(0, 0, Width, Height, Color.Gray);
|
||||
DrawString(PlaceholderText, PlaceholderForeground, 0, 0);
|
||||
|
||||
@@ -352,7 +352,6 @@ namespace CMLeonOS.Gui.UILib
|
||||
for (int i = markedLinesBegin; i <= markedLinesEnd; i++)
|
||||
{
|
||||
int lineY = (i * fontHeight) - scrollY;
|
||||
|
||||
if (lineY < 0) continue;
|
||||
if (lineY > Height) break;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.ShellComponents;
|
||||
using CMLeonOS.Settings;
|
||||
using CMLeonOS.Driver;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -16,7 +17,7 @@ namespace CMLeonOS.Gui
|
||||
Critical = true;
|
||||
}
|
||||
|
||||
private Cosmos.HAL.Drivers.Video.SVGAII.VMWareSVGAII driver;
|
||||
private VMWareSVGAII driver;
|
||||
|
||||
internal List<Window> Windows = new List<Window>();
|
||||
|
||||
@@ -122,7 +123,7 @@ namespace CMLeonOS.Gui
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
int sourceIndex = y * window.Width;
|
||||
driver.videoMemory.Copy(aByteOffset: byteOffset, aData: window.Buffer, aIndex: sourceIndex, aCount: width);
|
||||
driver.VideoMemory.Copy(aByteOffset: byteOffset, aData: window.Buffer, aIndex: sourceIndex, aCount: width);
|
||||
byteOffset += (int)(ScreenWidth * bytesPerPixel);
|
||||
}
|
||||
}
|
||||
@@ -217,7 +218,7 @@ namespace CMLeonOS.Gui
|
||||
|
||||
private void SetupDriver()
|
||||
{
|
||||
driver = new Cosmos.HAL.Drivers.Video.SVGAII.VMWareSVGAII();
|
||||
driver = new VMWareSVGAII();
|
||||
driver.SetMode(ScreenWidth, ScreenHeight, depth: bytesPerPixel * 8);
|
||||
}
|
||||
|
||||
@@ -229,7 +230,7 @@ namespace CMLeonOS.Gui
|
||||
MouseManager.X = ScreenWidth / 2;
|
||||
MouseManager.Y = ScreenHeight / 2;
|
||||
|
||||
driver.DefineAlphaCursor(cursorBitmap.Width, cursorBitmap.Height, cursorBitmap.RawData);
|
||||
driver.DefineAlphaCursor(cursorBitmap);
|
||||
}
|
||||
|
||||
private Window GetWindowAtPos(uint x, uint y)
|
||||
@@ -329,7 +330,7 @@ namespace CMLeonOS.Gui
|
||||
|
||||
private void RenderWallpaper()
|
||||
{
|
||||
driver.videoMemory.Copy((int)driver.FrameSize, wallpaperResized.RawData, 0, wallpaperResized.RawData.Length);
|
||||
driver.VideoMemory.Copy((int)driver.FrameSize, wallpaperResized.RawData, 0, wallpaperResized.RawData.Length);
|
||||
}
|
||||
|
||||
private void SetupWallpaper()
|
||||
|
||||
Reference in New Issue
Block a user